Open all85100 opened 5 years ago
Same for [AMXX] 1.90.
Here is solution.
Edit .sma and compile it manually, we have to do it, unless AMXX don't fix this issue in base, they provide.
-if (wpnindex == CSW_C4) +if (wpnindex == CSW_C4 || !is_user_connected(victim))
Can you submit the solution to Pull requests, no one will encounter such a problem in the future?
Same answer was posted on https://forums.alliedmods.net/showthread.php?t=316688
This is probably not the wanted solution because the stats should be saved and displayed (for killer) regardless of the victim is no more connected. Meaning to fix this, we need to track player's name and team instead so we don't rely on native (like cs_get_user_team) which throws an error if not connected.
@Arkshine So, what's alternative?
The main problem here is that I cannot imagine the case when victim can be disconnected. client_death
is based on DeathMsg
and Damage
usermsgs.
DeathMsg
is sent from CBasePlayer::Killed
->CHalfLifeMultiplay::PlayerKilled
->CHalfLifeMultiplay::DeathNotice
, so victim is this
from CBasePlayer::Killed
and cannot be disconnected by design.
Damage
is sent from CBasePlayer::UpdateClientData
, victim is also this
here, but I think in this case victim can be disconnected (e.g. in case of changelevel, but I'm not sure).
Before fixing that we need to find a root cause, so we will find a proper way to fix it.
This is probably not the wanted solution because the stats should be saved and displayed (for killer) regardless of the victim is no more connected. Meaning to fix this, we need to track player's name and team instead so we don't rely on native (like cs_get_user_team) which throws an error if not connected.
I think that simple fix should be applied.
Yes, it isn't the best way... but, at least, we stop the log error message. Then, investigate the correct way.
This is probably not the wanted solution because the stats should be saved and displayed (for killer) regardless of the victim is no more connected. Meaning to fix this, we need to track player's name and team instead so we don't rely on native (like cs_get_user_team) which throws an error if not connected.
I think that simple fix should be applied.
Yes, it isn't the best way... but, at least, we stop the log error message. Then, investigate the correct way.
Defeats the purpose of tracking down the error then.
Defeats the purpose of tracking down the error then.
Only the person who track the error should test. The other server owners will not want to have a bunch of log errors.
Error is posted here, so... it can't be forgotten by applying a patch.
L 08/18/2019 - 14:07:40: Start of error session. L 08/18/2019 - 14:07:40: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190818.log") L 08/18/2019 - 14:07:40: [CSTRIKE] Invalid player 6 (not in-game) L 08/18/2019 - 14:07:40: [AMXX] Run time error 10 (plugin "miscstats.amxx") (native "cs_get_user_team") - debug not enabled! L 08/18/2019 - 14:07:40: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).