server crashes due to exceeding the max edicts limit.
i know that game engine have 2048 limit of edicts, but in logs:
Code:
...
L 08/23/2019 - 17:34:19: (1.56%) 32 info_player_terrorist
L 08/23/2019 - 17:34:19: (1.56%) 32 info_player_counterterrorist
L 08/23/2019 - 17:34:19: (1.61%) 33 trigger_teleport
L 08/23/2019 - 17:34:19: (1.61%) 33 trigger_multiple
L 08/23/2019 - 17:34:19: (2.10%) 43 path_track
L 08/23/2019 - 17:34:19: (3.71%) 76 ambient_generic
L 08/23/2019 - 17:34:19: (7.27%) 149 env_entity_maker
L 08/23/2019 - 17:34:19: (66.86%) 1370 <---- no class edicts
L 08/23/2019 - 17:34:19: Total edicts: 2049
L 08/23/2019 - 17:34:19: Engine error: ED_Alloc: no free edicts
we can see that 1370 edicts spawning without class.
plugins to create an entity in server not installed. crashing on many maps.
What is this and how i can fix that ?.
upd. other servers can run that maps without reaching the limit.
upd2. i made a plugin, which also seems not working.
PHP Code:
public void OnEntityCreated(int entity) {
if(entity >= 2047) {
SDKHook(entity, SDKHook_Spawn, OnSpawn);
}
}
public Action OnSpawn(int entity) {
AcceptEntityInput(entity, "kill");
RemoveEdict(entity);
return Plugin_Handled;
}
public void OnGameFrame() {
for(int i = 2046; i <= 2048; i++) {
if(IsValidEntity(i) && IsValidEdict(i)) {
AcceptEntityInput(i, "kill");
RemoveEdict(i);
}
}
}