HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- egon client dll not sync after loading (https://hlfx.ru/forum/showthread.php?threadid=5846)
Отправлено rosario 01-06-2022 в 23:52:
egon client dll not sync after loading
Hello i have a problem with this weapon, were client side won't sync with server side after i load a saved game.
Specifically in my egon version i have added the SecondaryAttack() which its function is to change fire mode, and PrimaryAttack() first do a wind up then Attack().
I'll post this code
C++ Source Code:
1 | void CEgon::PrimaryAttack( void ) |
3 | switch ( m_iWindUpCharge ) |
8 | if (!(m_pPlayer->m_afButtonPressed & IN_ATTACK)) |
10 | EMIT_SOUND(ENT(pev), CHAN_WEAPON, EGON_SOUND_WINDUP, 1, ATTN_NORM); |
13 | case FIRE_NARROW: m_iRateOfFire = 0.45; break; |
14 | case FIRE_WIDE: m_iRateOfFire = 0.7; break; |
16 | m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + m_iRateOfFire; |
17 | m_iWindUpCharge = TRUE; |
20 | case TRUE: Attack(); break; |
24 | void CEgon::SecondaryAttack( void ) |
27 | if ( m_activity == OFF ) |
29 | if (!(m_pPlayer->m_afButtonPressed & IN_ATTACK2)) |
35 | EMIT_SOUND(ENT(pev), CHAN_ITEM, EGON_SOUND_MODE2, 1, ATTN_NORM); |
36 | SendWeaponAnim( EGON_ALTFIREON ); |
37 | m_fireMode = FIRE_WIDE; |
41 | EMIT_SOUND(ENT(pev), CHAN_ITEM, EGON_SOUND_MODE1, 1, ATTN_NORM); |
42 | SendWeaponAnim( EGON_ALTFIREOFF ); |
43 | m_fireMode = FIRE_NARROW; |
46 | m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.5; |
47 | m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.5; |
lets say i do a savegame while fire_narrow is selected, if i change to fire_wide and then i reload the savegame,
egon will shoot with fire_narrow values from server side but will use the fire_wide audio and effects from client side.
idk how to resolve, thx in advance for any answer.__________________
Ryzen 5 2600 | 16GB DDR4 | 1050Ti
Отправлено [CFR] B@N@N 02-06-2022 в 17:33:
I think you forgot to add new variables to save-load function
Отправлено rosario 02-06-2022 в 18:55:
in weapons.cpp within TYPEDESCRIPTION CEgon::m_SaveData[] = {} i were already added that define_field for m_activity, the others like for m_firemode already in by default.
idk where to look further
__________________
Ryzen 5 2600 | 16GB DDR4 | 1050Ti
Отправлено rosario 08-06-2022 в 08:27:
no solution for that?
__________________
Ryzen 5 2600 | 16GB DDR4 | 1050Ti
Отправлено [CFR] B@N@N 14-06-2022 в 09:28:
I hope no