Closed Icy-Inferno closed 3 years ago
Off-topic/out of scope for this issue, but I just noticed that l4d2_scoremod.sp doesn't explicitly handle ledge hangs, unlike l4d2_hybrid_scoremod.sp and l4d2_hybrid_scoremod_zone.sp. Hopefully this is just because netprop "m_isIncapacitated" on CTerrorPlayer is 1 whether ledge hanging or incapacitated?
I notice the latter two plugins use "m_isHangingFromLedge" and "m_isFallingFromLedge" netprops to handle ledge hangs, but I have to question how this could have possibly been broken in l4d2_scoremod.sp this entire time. EDIT: Turns out it was broken, but only very slightly. Confirmed via VScript that "m_isIncapacitated" is 1 when hanging from a ledge but NOT when falling from a ledge. Very niche case so I'm not surprised it's never come up. You'd have to be ledge falling exactly when the value for the "vs_survival_bonus" cvar is being determined.
This is also affecting other maps. It looks like incapped survivors within safe area contribute to the survival bonus in normal maps as well.
We got a game on zonemod last night where we had 2 alive survivors, and 1 incapped survivor, in end saferoom.
!health
read 60 bonus
, but we ended up with 3 x 30
points at the round end.
Looks like, in spite of my screenshot above, the behavior is actually still just inconsistent. Had some games where incapped survivors count. Lame!
Had this earlier, it's still behaving as before (not tested on finales) in Zonemod and EQ's hybrid bonus scoring. It doesn't count the incapped survivors in the Saferoom.
We're fine.
There was a change to the game's code to now count incapacitated survivors inside of a rescue vehicle as alive. (This doesn't currently seem to be the case on Parish finale for some reason). This is problematic for custom scoring in that we only ever treat upright survivors as alive for the purpose of determining how many times vs_survival_bonus will be multiplied by the game. To fix this, it would be necessary to determine if an incapacitated survivor is inside of/on a rescue vehicle (again, except for Parish finale as that currently seems to still exhibit the old behavior).
https://github.com/SirPlease/L4D2-Competitive-Rework/blob/master/addons/sourcemod/scripting/l4d2_hybrid_scoremod.sp#L525-L541
https://github.com/SirPlease/L4D2-Competitive-Rework/blob/master/addons/sourcemod/scripting/l4d2_hybrid_scoremod_zone.sp#L535-L551
https://github.com/SirPlease/L4D2-Competitive-Rework/blob/master/addons/sourcemod/scripting/l4d2_scoremod.sp#L373-L409
EDIT: The game event "finale_vehicle_leaving" possesses parameter "survivorcount".
From modevents.res:
Assuming this event fires at the correct time (it had better, considering scoremod.sp has always used it as a time to change the "vs_survival_bonus" cvar before scores get written), it should be possible to make use of this.