Optimize 71a8ca2a

This commit is contained in:
KingRainbow44 2023-04-11 21:09:52 -04:00
parent 97f74d9d55
commit 7bac95098a
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -511,14 +511,18 @@ public class ScriptLib {
return 0;
}
public int SetEntityServerGlobalValueByConfigId(int cfgId, String sgvName, int value){
public int SetEntityServerGlobalValueByConfigId(int cfgId, String sgvName, int value) {
logger.debug("[LUA] Call SetEntityServerGlobalValueByConfigId with {}, {}, {}",
cfgId, sgvName, value);
var scriptManager = this.getSceneScriptManager();
if (scriptManager == null) return 1;
var entity = scriptManager.getScene().getEntityByConfigId(cfgId);
var scene = scriptManager.getScene();
var entity = scene.getEntityByConfigId(cfgId);
if (entity == null) return 2;
scriptManager.getScene().getWorld().broadcastPacket(
scene.broadcastPacket(
new PacketServerGlobalValueChangeNotify(entity, sgvName, value));
return 0;
}