Fix SetMaxHP crashing if spawn ptr is invalid
This commit is contained in:
parent
31e13d5c58
commit
269cb74202
1 changed files with 1 additions and 1 deletions
|
@ -2016,7 +2016,7 @@ int EQ2Emu_lua_SetMaxHP(lua_State* state) {
|
|||
if (spawn && spawn->IsEntity() && value > 0)
|
||||
((Entity*)spawn)->AddSpellBonus(0, ITEM_STAT_HEALTH, value - spawn->GetTotalHP());
|
||||
|
||||
if (spawn->IsPlayer())
|
||||
if (spawn && spawn->IsPlayer())
|
||||
((Player*)spawn)->SetCharSheetChanged(true);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue