Sfoglia il codice sorgente

Fix SetMaxHP crashing if spawn ptr is invalid

Emagi 1 anno fa
parent
commit
269cb74202
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      EQ2/source/WorldServer/LuaFunctions.cpp

+ 1 - 1
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -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;