fix(AbilityModifier.java): Always parse param[1-3] as DynamicFloats

This commit is contained in:
KingRainbow44 2024-09-28 19:51:22 -04:00
parent 5167253136
commit 5b9d386e17
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
3 changed files with 13 additions and 4 deletions

View File

@ -345,9 +345,10 @@ public class AbilityModifier implements Serializable {
public DynamicFloat valueRangeMax; public DynamicFloat valueRangeMax;
public String overrideMapKey; public String overrideMapKey;
public int param1; public DynamicFloat
public int param2; param1 = DynamicFloat.ZERO,
public int param3; param2 = DynamicFloat.ZERO,
param3 = DynamicFloat.ZERO;
public String funcName; public String funcName;
public LuaCallType luaCallType; public LuaCallType luaCallType;

View File

@ -57,6 +57,10 @@ public class DynamicFloat {
return this.get(ability.getAbilitySpecials(), 0f); return this.get(ability.getAbilitySpecials(), 0f);
} }
public int getInt(Ability ability) {
return (int) this.get(ability.getAbilitySpecials(), 0f);
}
public float get(Object2FloatMap<String> props, float defaultValue) { public float get(Object2FloatMap<String> props, float defaultValue) {
if (!this.dynamic) return constant; if (!this.dynamic) return constant;

View File

@ -15,9 +15,13 @@ public class ActionExecuteGadgetLua extends AbilityActionHandler {
// Investigate if we need to use target // Investigate if we need to use target
if (owner.getEntityController() != null) { if (owner.getEntityController() != null) {
var param1 = action.param1.getInt(ability);
var param2 = action.param2.getInt(ability);
var param3 = action.param3.getInt(ability);
owner owner
.getEntityController() .getEntityController()
.onClientExecuteRequest(owner, action.param1, action.param2, action.param3); .onClientExecuteRequest(owner, param1, param2, param3);
return true; return true;
} }