mirror of
https://github.com/yquake2/xatrix.git
synced 2025-04-20 17:20:53 +00:00
Merge pull request #103 from BjossiAlfreds/door-use-fix
Fixed doors being unusable with NULL activator
This commit is contained in:
commit
2e95d187b5
1 changed files with 15 additions and 6 deletions
21
src/g_func.c
21
src/g_func.c
|
@ -1401,13 +1401,13 @@ door_go_up(edict_t *self, edict_t *activator)
|
|||
void
|
||||
door_use(edict_t *self, edict_t *other /* unused */, edict_t *activator)
|
||||
{
|
||||
if (!self || !activator)
|
||||
edict_t *ent;
|
||||
|
||||
if (!self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
edict_t *ent;
|
||||
|
||||
if (self->flags & FL_TEAMSLAVE)
|
||||
{
|
||||
return;
|
||||
|
@ -2446,13 +2446,22 @@ void
|
|||
trigger_elevator_use(edict_t *self, edict_t *other, edict_t *activator /* unused */)
|
||||
{
|
||||
edict_t *target;
|
||||
edict_t *train;
|
||||
|
||||
if (!self || !other)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (self->movetarget->nextthink)
|
||||
train = self->movetarget;
|
||||
|
||||
if (!train || !train->inuse ||
|
||||
!train->classname || strcmp(train->classname, "func_train") != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (train->nextthink)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -2471,8 +2480,8 @@ trigger_elevator_use(edict_t *self, edict_t *other, edict_t *activator /* unused
|
|||
return;
|
||||
}
|
||||
|
||||
self->movetarget->target_ent = target;
|
||||
train_resume(self->movetarget);
|
||||
train->target_ent = target;
|
||||
train_resume(train);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue