Closed JacobAsmuth closed 5 years ago
I do agree with the hook / functions being standardized. I know shit will break but perhaps we could deprecate them for a while and maybe throw off warnings so that server owners can bitch at addon creators to fix their addons in advance? I'm not really a huge fan of the things that this would break, but I've grown tired of coding gamemodes / addons for garry's mod just for the simple fact that it is just one big mess and there's no established standard and everything looks ugly.
It seems players aren't the only entities created on disconnect. These are created when a player exits a single-player game:
Entity [2][soundent]
Entity [3][player_manager]
Entity [4][gmod_gamerules]
Entity [5][bodyque]
Entity [6][bodyque]
Entity [7][bodyque]
Entity [8][bodyque]
Entity [9][ai_network]
Entity [174][spotlight_end]
Entity [175][beam]
Entity [176][spotlight_end]
Entity [177][beam]
Entity [178][spotlight_end]
Entity [179][beam]
Entity [180][spotlight_end]
Entity [181][beam]
Entity [182][spotlight_end]
Entity [183][beam]
Entity [116][physgun_beam]
Entity [120][predicted_viewmodel]
Entity [121][predicted_viewmodel]
Entity [122][scene_manager]
If you save the player’s entity in a variable while he played on the server, and then compare it with the player’s entity passed as an argument in the EntityRemoved hook, you will get a false result because these are different entities :sob: but same player and same EntIndex
Should be solved on Dev.
I know that was a convoluted bug description. Basically here's what happens:
http://facepunch.com/showthread.php?t=1374457&p=45460578#post45460578
edit: as a side note, can the hook names also be standardized? Either OnEntityRemoved or EntityCreated please!