From e1b62d2495e7bd4c7a63b94b4fc6b6e5075bb2e5 Mon Sep 17 00:00:00 2001 From: fl0werD Date: Tue, 14 Jan 2020 11:58:43 +0400 Subject: [PATCH] DefaultDeploy fix allocation string issue for 3rd-party (#494) --- regamedll/dlls/weapons.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 30641f5c..8478e83d 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -1310,8 +1310,13 @@ BOOL EXT_FUNC CBasePlayerWeapon::__API_HOOK(DefaultDeploy)(char *szViewModel, ch return FALSE; m_pPlayer->TabulateAmmo(); +#ifdef REGAMEDLL_API + m_pPlayer->pev->viewmodel = ALLOC_STRING(szViewModel); + m_pPlayer->pev->weaponmodel = ALLOC_STRING(szWeaponModel); +#else m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel); m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel); +#endif model_name = m_pPlayer->pev->viewmodel; Q_strcpy(m_pPlayer->m_szAnimExtention, szAnimExt); SendWeaponAnim(iAnim, skiplocal);