File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -750,17 +750,26 @@ int ObjectRef::l_set_properties(lua_State *L)
750
750
NO_MAP_LOCK_REQUIRED;
751
751
ObjectRef *ref = checkobject (L, 1 );
752
752
ServerActiveObject *co = getobject (ref);
753
- if (co == NULL ) return 0 ;
753
+ if (!co)
754
+ return 0 ;
755
+
754
756
ObjectProperties *prop = co->accessObjectProperties ();
755
757
if (!prop)
756
758
return 0 ;
759
+
757
760
read_object_properties (L, 2 , prop, getServer (L)->idef ());
761
+
758
762
if (prop->hp_max < co->getHP ()) {
759
763
PlayerHPChangeReason reason (PlayerHPChangeReason::SET_HP);
760
764
co->setHP (prop->hp_max , reason);
761
765
if (co->getType () == ACTIVEOBJECT_TYPE_PLAYER)
762
766
getServer (L)->SendPlayerHPOrDie ((PlayerSAO *)co, reason);
763
767
}
768
+
769
+ if (co->getType () == ACTIVEOBJECT_TYPE_PLAYER &&
770
+ prop->breath_max < co->getBreath ())
771
+ co->setBreath (prop->breath_max );
772
+
764
773
co->notifyObjectPropertiesModified ();
765
774
return 0 ;
766
775
}
You can’t perform that action at this time.
0 commit comments