Pass player object to check_trigger_sub
This commit is contained in:
parent
84e596e1b4
commit
171e303adb
|
@ -169,7 +169,7 @@ constexpr uint8_t trigger_none = 0xff;
|
||||||
extern void trigger_init();
|
extern void trigger_init();
|
||||||
namespace dsx {
|
namespace dsx {
|
||||||
void check_trigger(vcsegptridx_t seg, short side, vcobjptridx_t objnum, int shot);
|
void check_trigger(vcsegptridx_t seg, short side, vcobjptridx_t objnum, int shot);
|
||||||
int check_trigger_sub(trgnum_t trigger_num, int player_num,int shot);
|
int check_trigger_sub(object &, trgnum_t trigger_num, int player_num,int shot);
|
||||||
|
|
||||||
static inline int trigger_is_exit(const trigger *t)
|
static inline int trigger_is_exit(const trigger *t)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2268,7 +2268,7 @@ static void multi_do_trigger(const playernum_t pnum, const ubyte *buf)
|
||||||
Int3(); // Illegal trigger number in multiplayer
|
Int3(); // Illegal trigger number in multiplayer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
check_trigger_sub(trigger, pnum,0);
|
check_trigger_sub(get_local_plrobj(), trigger, pnum,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DXX_BUILD_DESCENT_II)
|
#if defined(DXX_BUILD_DESCENT_II)
|
||||||
|
|
|
@ -268,7 +268,7 @@ static void do_il_off(const trigger &t)
|
||||||
trigger_wall_op(t, vsegptridx, op);
|
trigger_wall_op(t, vsegptridx, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
int check_trigger_sub(const trgnum_t trigger_num, int pnum,int shot)
|
int check_trigger_sub(object &plrobj, const trgnum_t trigger_num, int pnum,int shot)
|
||||||
{
|
{
|
||||||
if (pnum < 0 || pnum > MAX_PLAYERS)
|
if (pnum < 0 || pnum > MAX_PLAYERS)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -279,9 +279,9 @@ int check_trigger_sub(const trgnum_t trigger_num, int pnum,int shot)
|
||||||
#if defined(DXX_BUILD_DESCENT_I)
|
#if defined(DXX_BUILD_DESCENT_I)
|
||||||
(void)shot;
|
(void)shot;
|
||||||
if (pnum == Player_num) {
|
if (pnum == Player_num) {
|
||||||
auto &player_info = get_local_plrobj().ctype.player_info;
|
auto &player_info = plrobj.ctype.player_info;
|
||||||
if (trigger.flags & TRIGGER_SHIELD_DAMAGE) {
|
if (trigger.flags & TRIGGER_SHIELD_DAMAGE) {
|
||||||
get_local_plrobj().shields -= trigger.value;
|
plrobj.shields -= trigger.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trigger.flags & TRIGGER_EXIT) {
|
if (trigger.flags & TRIGGER_EXIT) {
|
||||||
|
@ -341,7 +341,7 @@ int check_trigger_sub(const trgnum_t trigger_num, int pnum,int shot)
|
||||||
if (Current_level_num > 0) {
|
if (Current_level_num > 0) {
|
||||||
start_endlevel_sequence();
|
start_endlevel_sequence();
|
||||||
} else if (Current_level_num < 0) {
|
} else if (Current_level_num < 0) {
|
||||||
if (get_local_plrobj().shields < 0 ||
|
if (plrobj.shields < 0 ||
|
||||||
Player_dead_state != player_dead_state::no)
|
Player_dead_state != player_dead_state::no)
|
||||||
break;
|
break;
|
||||||
// NMN 04/09/07 Do endlevel movie if we are
|
// NMN 04/09/07 Do endlevel movie if we are
|
||||||
|
@ -369,7 +369,7 @@ int check_trigger_sub(const trgnum_t trigger_num, int pnum,int shot)
|
||||||
if (pnum!=Player_num)
|
if (pnum!=Player_num)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (get_local_plrobj().shields < 0 ||
|
if (plrobj.shields < 0 ||
|
||||||
Player_dead_state != player_dead_state::no)
|
Player_dead_state != player_dead_state::no)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ void check_trigger(const vcsegptridx_t seg, short side, const vcobjptridx_t objn
|
||||||
if (trigger_num == trigger_none)
|
if (trigger_num == trigger_none)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (check_trigger_sub(trigger_num, Player_num,shot))
|
if (check_trigger_sub(get_local_plrobj(), trigger_num, Player_num,shot))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if defined(DXX_BUILD_DESCENT_I)
|
#if defined(DXX_BUILD_DESCENT_I)
|
||||||
|
|
Loading…
Reference in a new issue