Telemenu: Fix view_ofs not correctly set at teleportation

This commit is contained in:
Freeman-AM 2014-05-21 00:59:48 +02:00
parent d3bae33c64
commit 44b4ff6f05

View File

@ -102,7 +102,36 @@ public actionTelMenu(id, key)
if (g_menuOption[id] > 0)
{
if ( HasInDuckingStateSaved(id) )
{
new sz_modname[16]
get_modname(sz_modname, charsmax(sz_modname))
if (equal(sz_modname, "cstrike") // Counter-Strike 1.6
|| equal(sz_modname, "czero") // Counter-Strike: Condition Zero
|| equal(sz_modname, "valve") // Half-Life
|| equal(sz_modname, "tfc") // Team Fortress Classic
|| equal(sz_modname, "gearbox")) // Half-Life: Opposing Force
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
set_pev(id, pev_view_ofs, {0.0, 0.0, 12.0})
}
else if (equal(sz_modname, "dod")) // Day of Defeat
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
set_pev(id, pev_view_ofs, {0.0, 0.0, 18.0})
}
else if (equal(sz_modname, "ns")) // Natural Selection
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
// Natural Selection handle view_ofs by itself
}
else if (equal(sz_modname, "ts")) // The Specialists
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
set_pev(id, pev_view_ofs, {0.0, 0.0, 16.0})
}
// Don't add this feature for mods that we don't know how their view_ofs work
}
engfunc(EngFunc_SetOrigin, player, g_menuOrigin[id])
set_pev(player, pev_angles, g_menuVAngle[id])
set_pev(player, pev_fixangle, 1)
@ -112,7 +141,36 @@ public actionTelMenu(id, key)
pev(id, pev_origin, f_origin)
pev(id, pev_v_angle, f_vangle)
if ( HasInDuckingStateSaved(id) )
{
new sz_modname[16]
get_modname(sz_modname, charsmax(sz_modname))
if (equal(sz_modname, "cstrike") // Counter-Strike 1.6
|| equal(sz_modname, "czero") // Counter-Strike: Condition Zero
|| equal(sz_modname, "valve") // Half-Life
|| equal(sz_modname, "tfc") // Team Fortress Classic
|| equal(sz_modname, "gearbox")) // Half-Life: Opposing Force
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
set_pev(id, pev_view_ofs, {0.0, 0.0, 12.0})
}
else if (equal(sz_modname, "dod")) // Day of Defeat
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
set_pev(id, pev_view_ofs, {0.0, 0.0, 18.0})
}
else if (equal(sz_modname, "ns")) // Natural Selection
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
// Natural Selection handle view_ofs by itself
}
else if (equal(sz_modname, "ts")) // The Specialists
{
set_pev(player, pev_flags, pev(player, pev_flags) | FL_DUCKING)
set_pev(id, pev_view_ofs, {0.0, 0.0, 16.0})
}
// Don't add this feature for mods that we don't know how their view_ofs work
}
engfunc(EngFunc_SetOrigin, player, f_origin)
set_pev(player, pev_angles, f_vangle)
set_pev(player, pev_fixangle, 1)