You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When firing an RPG with laser dot turned on and the rocket flies into any kind of water (on old maps skies are non-solid and behave like water), if the rocket exits the water and has a speed below 1500 units/sec the rocket will detonate without informing the launcher about it. The launcher won't let you reload if the laser is turned on and any rockets are active, so this stops you from reloading.
This can be easily tested by loading the map c2a5, jumping into the water and swimming to the bottom and then firing a rocket straight up.
An even better solution would be to update the launcher in the rocket's destructor, but entity destructors aren't called in SDK code so for the purposes of this fix i've limited it to using available solutions.
Note also that doing this in the destructor can cause crashes if the rocket is in flight when a map change or disconnect occurs due to #1719. Changing the launcher pointer to an EHANDLE will still cause edge cases due to #1755, which is why i've changed the code above to compare against nullptr which forces a proper null check.
The text was updated successfully, but these errors were encountered:
When firing an RPG with laser dot turned on and the rocket flies into any kind of water (on old maps skies are non-solid and behave like water), if the rocket exits the water and has a speed below 1500 units/sec the rocket will detonate without informing the launcher about it. The launcher won't let you reload if the laser is turned on and any rockets are active, so this stops you from reloading.
This can be easily tested by loading the map
c2a5
, jumping into the water and swimming to the bottom and then firing a rocket straight up.This video shows the bug:
https://www.youtube.com/watch?v=-AUqwI1P-Oc
Active rocket check here:
halflife/dlls/rpg.cpp
Lines 310 to 315 in c7240b9
Rocket informs the launcher here, if it detonates on touch:
halflife/dlls/rpg.cpp
Lines 155 to 159 in c7240b9
Rocket slows down to 300 units/sec here when fully underwater:
halflife/dlls/rpg.cpp
Lines 247 to 255 in c7240b9
Rocket detonates without informing the launcher if going slower than 1500 units/sec while not touching underwater here:
halflife/dlls/rpg.cpp
Lines 272 to 275 in c7240b9
To fix this, when the rocket is detonated it needs to inform the launcher:
Move this code:
halflife/dlls/rpg.cpp
Lines 155 to 159 in c7240b9
To its own method:
Change this:
halflife/dlls/rpg.cpp
Lines 273 to 275 in c7240b9
To this:
An even better solution would be to update the launcher in the rocket's destructor, but entity destructors aren't called in SDK code so for the purposes of this fix i've limited it to using available solutions.
Note also that doing this in the destructor can cause crashes if the rocket is in flight when a map change or disconnect occurs due to #1719. Changing the launcher pointer to an EHANDLE will still cause edge cases due to #1755, which is why i've changed the code above to compare against nullptr which forces a proper null check.
The text was updated successfully, but these errors were encountered: