소스 검색

Fix SetMaxHP crashing if spawn ptr is invalid

Emagi 1 년 전
부모
커밋
269cb74202
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;