View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002564 | FSSCP | math-related | public | 2012-01-14 00:06 | 2012-01-15 11:17 |
Reporter | Echelon9 | Assigned To | Echelon9 | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.6.14 RC2 | ||||
Target Version | 3.6.14 RC2 | Fixed in Version | 3.6.14 RC2 | ||
Summary | 0002564: GCC warning: Use of NULL in arithmetic operation in ship.cpp (winfo_p->pre_launch_snd != NULL) | ||||
Description | A NULL comparison check here is incorrect, as we are checking against an int not a pointer. The correct check is against the value assigned to pre_launch_snd when a nonexistent sound was provided from the tables. The table parsing ultimately calls parse_sound_core(): Warning(LOCATION, "%s sound index out of range on '%s'. Must be between 0 and %d. Forcing to -1 (Nonexistent sound).\n", tag, object_name, size_to_check); | ||||
Tags | No tags attached. | ||||
|
Fixed in revision 8209 |
|
Apparently, -1 in place of NULL causes Primary Weapons fire to play the Missile Lock On sound instead. (Only for single shots, press and hold to repeat fire, and the actual primary weapon sfx comes through) |
|
preLaunchSndFix.svn.patch (574 bytes)
Index: code/weapon/weapons.cpp =================================================================== --- code/weapon/weapons.cpp +++ code/weapon/weapons.cpp @@ -856,11 +856,14 @@ void init_weapon_entry(int weap_info_index) wip->catchup_pixels_per_sec = 50; wip->catchup_pixel_penalty = 50; wip->seeker_strength = 1.0f; - + wip->swarm_count = -1; // *Default is 150 -Et1 wip->SwarmWait = SWARM_MISSILE_DELAY; + wip->pre_launch_snd = -1; + wip->pre_launch_snd_min_interval = 0; + wip->launch_snd = -1; wip->impact_snd = -1; wip->disarmed_impact_snd = -1; |
|
attached fix |
|
The NULL to -1 change has revealed a related bug in init_weapon_entry() which Eli2 has helpfully provided a patch for -- that patch should be good to go in trunk. |
|
Related issue that was uncovered has been fixed in 8228. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-01-14 00:06 | Echelon9 | New Issue | |
2012-01-14 00:06 | Echelon9 | Status | new => assigned |
2012-01-14 00:06 | Echelon9 | Assigned To | => Echelon9 |
2012-01-15 00:59 | Echelon9 | Note Added: 0013047 | |
2012-01-15 00:59 | Echelon9 | Status | assigned => resolved |
2012-01-15 00:59 | Echelon9 | Fixed in Version | => 3.6.14 RC2 |
2012-01-15 00:59 | Echelon9 | Resolution | open => fixed |
2012-01-15 10:33 | Zacam | Note Added: 0013052 | |
2012-01-15 10:33 | Zacam | Status | resolved => feedback |
2012-01-15 10:33 | Zacam | Resolution | fixed => reopened |
2012-01-15 10:44 | Eli2 | File Added: preLaunchSndFix.svn.patch | |
2012-01-15 10:44 | Eli2 | Note Added: 0013053 | |
2012-01-15 11:12 | Echelon9 | Note Added: 0013055 | |
2012-01-15 11:12 | Echelon9 | Status | feedback => assigned |
2012-01-15 11:17 | Echelon9 | Note Added: 0013056 | |
2012-01-15 11:17 | Echelon9 | Status | assigned => resolved |
2012-01-15 11:17 | Echelon9 | Resolution | reopened => fixed |