File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -759,16 +759,17 @@ int ObjectRef::l_set_properties(lua_State *L)
759
759
760
760
read_object_properties (L, 2 , prop, getServer (L)->idef ());
761
761
762
+ PlayerSAO *player = getplayersao (ref);
763
+
762
764
if (prop->hp_max < co->getHP ()) {
763
765
PlayerHPChangeReason reason (PlayerHPChangeReason::SET_HP);
764
766
co->setHP (prop->hp_max , reason);
765
- if (co-> getType () == ACTIVEOBJECT_TYPE_PLAYER )
766
- getServer (L)->SendPlayerHPOrDie ((PlayerSAO *)co , reason);
767
+ if (player )
768
+ getServer (L)->SendPlayerHPOrDie (player , reason);
767
769
}
768
770
769
- if (co->getType () == ACTIVEOBJECT_TYPE_PLAYER &&
770
- prop->breath_max < co->getBreath ())
771
- co->setBreath (prop->breath_max );
771
+ if (player && prop->breath_max < player->getBreath ())
772
+ player->setBreath (prop->breath_max );
772
773
773
774
co->notifyObjectPropertiesModified ();
774
775
return 0 ;
You can’t perform that action at this time.
0 commit comments