[Fix] GetGadgetConfigId uses gadget_eid not group_eid (#32)

This commit is contained in:
Nazrin 2024-10-11 01:07:56 -07:00 committed by GitHub
parent 8650f6c7f2
commit bcc3dbdc5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1175,7 +1175,7 @@ public class ScriptLib {
*/
public static int GetGadgetIdByEntityId(GroupEventLuaContext context, int entityId){
if(entityId <= 0){
scriptLogger.error(() -> "[GetGadgetIdByEntityId] Invalid or missing group_eid " + entityId);
scriptLogger.error(() -> "[GetGadgetIdByEntityId] Invalid or missing entityId " + entityId);
return INVALID_PARAMETER.getValue();
}
return context.getScriptLibHandlerProvider().getGroupGadgetHandler().GetGadgetIdByEntityId(context, entityId);
@ -1202,12 +1202,12 @@ public class ScriptLib {
*/
public static int GetGadgetConfigId(GroupEventLuaContext context, Object paramsTable){
val params = context.getEngine().getTable(paramsTable);
val groupEid = params.optInt("group_eid", -1);
if(groupEid <= 0){
scriptLogger.error(() -> "[GetGadgetConfigId] Invalid or missing group_eid " + groupEid);
val gadgetEid = params.optInt("gadget_eid", -1);
if(gadgetEid <= 0){
scriptLogger.error(() -> "[GetGadgetConfigId] Invalid or missing gadget_eid " + gadgetEid);
return INVALID_PARAMETER_TABLE_CONTENT.getValue();
}
return context.getScriptLibHandlerProvider().getGroupGadgetHandler().GetGadgetConfigId(context, groupEid);
return context.getScriptLibHandlerProvider().getGroupGadgetHandler().GetGadgetConfigId(context, gadgetEid);
}
/**