Skip to content

Using morex on wand graphics crashes sphere #1538

@mtwango

Description

@mtwango

When using an item with morex, even nonmagical type like bellow, it crashes the sphere, because it wants to cast a spell (from morex) without setting the caster.

Following item:

[ITEMDEF i_wand_of_jail]
id=0df2
name=GM's Wand of Jail
type=t_weapon_mace_sharp

on=@create
  attr=attr_newbie
  hitpoints=100

on=@dclick
  morex=<src.account.plevel>
  serv.log plevel: <morex>
  if (<morex> < 2)
    src.sysmessage You Wouldn't Steal a Wand 
    src.hits=0
    remove
    return 1
  endif
  src.message Select a player...
  return 0

used with plevel 7 crashes the sphere here:

pSpell->m_itSpell.m_PolyStr = (int16)pSpellDef->m_vcEffect.GetLinear(pCaster->Skill_GetBase((SKILL_TYPE)iSkill)) / 10; // % of damage reflected.

because pCaster is null (defined here):

CChar *pCaster = pSpell->m_uidLink.CharFind();

But as it is neither magical, neither wand (by type, not by graphics), it should event try to cast the spell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions