-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GTA SA: Weapon limits cause script command GET_WEAPONTYPE_MODEL crash #12
Comments
Same happens with get_weapontype_slot and probably other weapon related commands. |
If you see data\gtasa_weapon_config.dat `# IDs 47 to 59 are reserved for internal game usage 47 LAST_WEAPONTYPE48 ARMOUR49 RAMMEDBYCAR50 RUNOVERBYCAR51 EXPLOSION52 UZI_DRIVEBY53 DROWNING54 FALL55 UNIDENTIFIED56 ANYMELEE57 ANYWEAPON58 FLARE59 TANK_GRENADE`There's a comment left about these IDs. User operated weapons have their line in gtasa_weapon_config.dat and weapon.dat. In standard game CWeaponInfo::GetWeaponInfo would return a pointer, even if weapon ID is invalid. In default game:
CWeaponInfo::GetWeaponInfo((eWeaponID)47, WEAPONSKILL_STD) would return a pointer to aWeaponInfo[47]. This is PISTOL's WEAPONSKILL_POOR line from weapon.dat. It would return the model ID of PISTOL's WEAPONSKILL_POOR line. It would return a garbage value, useless value. The FLA does something different - CWeaponInfo::GetWeaponInforeturns NULL, if valid user-operated weapon ID has not been provided. So it returned NULL for ID 47, the SCM command tried accessing that NULL pointer to read model ID and game crashed. It works as expected, better than in standard game. |
GTA SA 1.0 US
Clean F92LA 7.6 installation.
After enabling settings in ini file:
Calling vanilla game's script command GET_WEAPONTYPE_MODEL with weapon id 47 crashes the game:
Without F92LA installed script command returns proper value 346.
Test CLEO script:
The text was updated successfully, but these errors were encountered: