Skip to content

Commit 83ca44a

Browse files
authored
Fix getVehicleSirensOn/setVehicleSirensOn for Rhino and Barracks (#4899) (#4900)
#### Summary Add `VEHICLE_HAS_SIRENS` to Rhino (432) and Barracks (433) in `g_ulVehicleAttributes` on both client and server, plus the `gentable_vehattr` generator. #### Motivation Resolves #4899. Both vehicles have functional sirens in vanilla SA, but `HasSirens()` rejected them because the bit was missing from the attribute table. As a result, `getVehicleSirensOn` returned `nil` and `setVehicleSirensOn` was a no-op. #### Test plan 1. Spawn a Rhino and a Barracks. 2. Run `setVehicleSirensOn(vehicle, true)`, then `getVehicleSirensOn(vehicle)`. Expected: `true`. 3. Run `setVehicleSirensOn(vehicle, false)`, then `getVehicleSirensOn(vehicle)`. Expected: `false`. 4. Confirm existing siren vehicles (e.g. Police 596, Ambulance 416, Enforcer 427) still toggle correctly. #### Checklist * [x] Your code should follow the [coding guidelines](https://wiki.multitheftauto.com/index.php?title=Coding_guidelines). * [x] Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.
1 parent 13fddf7 commit 83ca44a

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

Client/mods/deathmatch/logic/CClientVehicleManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const SFixedArray<unsigned char, 212> g_ucMaxPassengers = {3, 1, 1, 1, 3,
4343
// Generated by MTA10\utils\gentable\gentable_vehattr.cpp
4444
static const SFixedArray<unsigned long, 212> g_ulVehicleAttributes = {
4545
0, 0, 0, 0, 0, 0, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 32, 0, 0, 2, 0, // 400-424
46-
0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, // 425-449
46+
0, 0, 2, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 32, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, // 425-449
4747
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 450-474
4848
0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, // 475-499
4949
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 4, 12, 0, 0, 2, 8, // 500-524

Client/utils/gentable/gentable_vehattr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ int main()
5050
SetAttribute(table, 599, VEHICLE_HAS_SIRENS);
5151
SetAttribute(table, 601, VEHICLE_HAS_SIRENS);
5252
SetAttribute(table, 423, VEHICLE_HAS_SIRENS);
53+
SetAttribute(table, 432, VEHICLE_HAS_SIRENS);
54+
SetAttribute(table, 433, VEHICLE_HAS_SIRENS);
5355

5456
SetAttribute(table, 592, VEHICLE_HAS_LANDING_GEARS);
5557
SetAttribute(table, 577, VEHICLE_HAS_LANDING_GEARS);

Server/mods/deathmatch/logic/CVehicleManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static const SFixedArray<unsigned char, 212> g_ucMaxPassengers = {{3, 1, 1,
4141
// Generated by MTA10\utils\gentable\gentable_vehattr.cpp
4242
static const SFixedArray<unsigned long, 212> g_ulVehicleAttributes = {
4343
{0, 0, 0, 0, 0, 0, 8, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 32, 0, 0, 2, 0, // 400-424
44-
0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, // 425-449
44+
0, 0, 2, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 32, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, // 425-449
4545
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 450-474
4646
0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 64, 0, 0, // 475-499
4747
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 4, 12, 0, 0, 2, 8, // 500-524

0 commit comments

Comments
 (0)