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
Attach to the weapon scope which has non-zero index in 'm_scopes'
Drop the weapon and switch it offline by running from it
Return to the weapon and take it into the hands
See MAGIC: the weapon has scope of another type!
Solution:
The problem appears because CSE_ALifeItemWeapon class has no field to store scope type. Gunslinger mod uses bithacking of m_addon_flags field (writing scope index into the left 5 bits of the field in net_Destroy). This way provides best compatibility with original game, but leads to some restrictions (up to 32 types of scopes) and not fully proper.
More correct way is to extend CSE_ALifeItemWeapon with extra field and export/import data from it when the weapon spawns/destroys. The problem is that such fix could conflict with some game's or mod's content.
P.S. The same bug you could see with ammos in the mag (if the weapon has different ammo types loaded). Moreover, info about types is losing during simple game saving and loading! It allows cheating with transformation cartridges from one type to another.
The text was updated successfully, but these errors were encountered:
FreeZoneMods
changed the title
[Bugs] Some info about info is losing when it switches offline
[Bugs] Some info about weapon is losing when it switches offline
Aug 5, 2017
Steps to reproduce:
Solution:
The problem appears because CSE_ALifeItemWeapon class has no field to store scope type. Gunslinger mod uses bithacking of m_addon_flags field (writing scope index into the left 5 bits of the field in net_Destroy). This way provides best compatibility with original game, but leads to some restrictions (up to 32 types of scopes) and not fully proper.
More correct way is to extend CSE_ALifeItemWeapon with extra field and export/import data from it when the weapon spawns/destroys. The problem is that such fix could conflict with some game's or mod's content.
P.S. The same bug you could see with ammos in the mag (if the weapon has different ammo types loaded). Moreover, info about types is losing during simple game saving and loading! It allows cheating with transformation cartridges from one type to another.
The text was updated successfully, but these errors were encountered: