Skip to content

Commit

Permalink
Actually reset the weapon pool, dummy
Browse files Browse the repository at this point in the history
  • Loading branch information
MjnMixael committed Sep 14, 2023
1 parent 0220ad0 commit baa34f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions code/missionui/missionweaponchoice.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef __MISSION_WEAPON_CHOICE_H__
#define __MISSION_WEAPON_CHOICE_H__

#include "mission/missionparse.h"

class p_object;
struct wss_unit;
class ship_weapon;
Expand Down Expand Up @@ -83,6 +85,7 @@ void wl_bash_ship_weapons(ship_weapon *swp, wss_unit *slot);

void wl_set_default_weapons(int index, int ship_class);
void wl_reset_to_defaults();
void wl_init_pool(team_data* td);
void wl_fill_slots();

// Set selected slot to first placed ship
Expand Down
6 changes: 5 additions & 1 deletion code/scripting/api/libs/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,13 +1425,17 @@ ADE_FUNC(resetSelect,
nullptr)
{
// Note this does all the things from ss_reset_to_default() in missionshipchoice.cpp except
// resetting UI elements - Mjn
// resetting UI elements. It also resets the weapon pool. - Mjn

SCP_UNUSED(L); // unused parameter

//Reset ships pool
ss_init_pool(&Team_data[Common_team]);
ss_init_units();

//Reset weapons pool
wl_init_pool(&Team_data[Common_team]);

if (!(Game_mode & GM_MULTIPLAYER)) {
wl_fill_slots();
}
Expand Down

0 comments on commit baa34f1

Please sign in to comment.