mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
CItemAirBox: Fix flight to the moon! (#697)
* Update item_airbox.cpp Also reset the velocity on Touch, just to avoid the "invisible" entity to keep moving. Let the reset on "Restart" too in case of, despite facultative. Final version: Reset all the axes of the velocity to make the sure the item spawns with a complete null velocity (I did not do that before more in order to take in consideration the possible custom X/Y speed we could give to them, like via plugin, but I finally decided to clean up all, the plugins could still affect it later if needed).
This commit is contained in:
parent
b9cccc691b
commit
53181d3e9b
@ -63,6 +63,7 @@ void CItemAirBox::Touch(CBaseEntity *pOther)
|
|||||||
|
|
||||||
pev->nextthink = 0;
|
pev->nextthink = 0;
|
||||||
SetThink(nullptr);
|
SetThink(nullptr);
|
||||||
|
pev->velocity = g_vecZero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,6 +71,12 @@ void CItemAirBox::Restart()
|
|||||||
{
|
{
|
||||||
CArmoury::Restart();
|
CArmoury::Restart();
|
||||||
UTIL_SetOrigin(pev, pev->oldorigin);
|
UTIL_SetOrigin(pev, pev->oldorigin);
|
||||||
|
pev->velocity = g_vecZero;
|
||||||
|
|
||||||
|
if(m_flyup < 0)
|
||||||
|
{
|
||||||
|
m_flyup = -m_flyup;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_flyup > 0 && m_delay > 0.01f)
|
if (m_flyup > 0 && m_delay > 0.01f)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user