Moving the DisplayDollItemSync hook inside null check.
In crafted (hacked) packet sending, people could send the DisplayDollItemSync packet with an entity ID that is not actually a display doll. This would not happen in a normal scenario. If they send the crafted packet, our hook would have been invoked and it would have contain a null TEDisplayDoll object since we tried to get the TileEntity object as a TEDisplayDoll object.
This commit is contained in:
parent
10a9ee399a
commit
90dd61e668
1 changed files with 3 additions and 4 deletions
|
|
@ -3797,11 +3797,10 @@ namespace TShockAPI
|
||||||
|
|
||||||
if (oldItem.type == 0 && newItem.type == 0)
|
if (oldItem.type == 0 && newItem.type == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (OnDisplayDollItemSync(args.Player, args.Data, playerIndex, tileEntityID, displayDoll, slot, isDye, oldItem, newItem))
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OnDisplayDollItemSync(args.Player, args.Data, playerIndex, tileEntityID, displayDoll, slot, isDye, oldItem, newItem))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue