Add helper to get pointer to reactor definition
This commit is contained in:
parent
8f95f0120d
commit
62ef6abefe
|
@ -348,7 +348,7 @@ void do_controlcen_frame(object *obj)
|
|||
controlcen_death_silence = 0;
|
||||
|
||||
if ((Control_center_next_fire_time < 0) && !(controlcen_death_silence > F1_0*2)) {
|
||||
reactor *reactor = &Reactors[obj->id];
|
||||
reactor *reactor = get_reactor_definition(obj->id);
|
||||
if (Players[Player_num].flags & PLAYER_FLAGS_CLOAKED)
|
||||
best_gun_num = calc_best_gun(reactor->n_guns, obj, &Believed_player_pos);
|
||||
else
|
||||
|
@ -459,7 +459,7 @@ void init_controlcen_for_level(void)
|
|||
} else {
|
||||
// Compute all gun positions.
|
||||
objp = &Objects[cntrlcen_objnum];
|
||||
reactor *reactor = &Reactors[objp->id];
|
||||
reactor *reactor = get_reactor_definition(objp->id);
|
||||
for (i=0; i<reactor->n_guns; i++)
|
||||
calc_controlcen_gun_point(reactor, objp, i);
|
||||
Control_center_present = 1;
|
||||
|
|
|
@ -62,6 +62,11 @@ static inline int get_reactor_model_number(int id)
|
|||
return Reactors[id].model_num;
|
||||
}
|
||||
|
||||
static inline reactor *get_reactor_definition(int id)
|
||||
{
|
||||
return &Reactors[id];
|
||||
}
|
||||
|
||||
//@@extern int N_controlcen_guns;
|
||||
extern int Control_center_been_hit;
|
||||
extern int Control_center_player_been_seen;
|
||||
|
|
Loading…
Reference in a new issue