Skip to content

Commit 9f59507

Browse files
committed
fix: fix entity.setMaxHealth #291
1 parent 5698326 commit 9f59507

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/legacy/api/EntityAPI.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,6 @@ Local<Value> EntityClass::setUnderwaterMovementSpeed(const Arguments& args) {
11521152

11531153
MutableAttributeWithContext attribute =
11541154
entity->getMutableAttribute(SharedAttributes::UNDERWATER_MOVEMENT_SPEED());
1155-
auto& instance = attribute.mInstance;
11561155
AttributeHelper::setCurrentValue(attribute, args[0].asNumber().toFloat());
11571156

11581157
return Boolean::newBoolean(true);
@@ -1185,7 +1184,7 @@ Local<Value> EntityClass::setMaxHealth(const Arguments& args) {
11851184
if (!entity) return Local<Value>();
11861185

11871186
MutableAttributeWithContext attribute = entity->getMutableAttribute(SharedAttributes::HEALTH());
1188-
AttributeHelper::setCurrentValue(attribute, args[0].asNumber().toFloat());
1187+
AttributeHelper::setMaxValue(attribute, args[0].asNumber().toFloat());
11891188

11901189
return Boolean::newBoolean(true);
11911190
}

0 commit comments

Comments
 (0)