Skip to content

Commit 2a574ef

Browse files
Goober5000MageKing17
authored andcommitted
some riffs on PR #806 (#1163)
In ship::clear(), The E removed memset(&weapons, 0, sizeof(ship_weapon)); but did not add a corresponding weapons = ship_weapon(); This fixes that. Additionally, this PR removes one of the two uses of ship::clear() by tweaking hud_observer_init. Originally, the code used memcpy, but if the assignment operator works for ai_info, it should be suitable for ship too.
1 parent 1767b7a commit 2a574ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

code/ship/ship.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5821,6 +5821,8 @@ void ship::clear()
58215821
target_shields_delta = 0.0f;
58225822
target_weapon_energy_delta = 0.0f;
58235823

5824+
weapons = ship_weapon();
5825+
58245826
// ---------- special weapons init that isn't setting things to 0
58255827
for (i = 0; i < MAX_SHIP_PRIMARY_BANKS; i++)
58265828
{

0 commit comments

Comments
 (0)