Disable Minecart Spawners for players already riding a minecart

This commit is contained in:
Tatsuru 2019-12-31 00:38:09 -03:00
parent 3d724f302d
commit 47b096a357

View file

@ -1807,23 +1807,27 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return; return;
case MT_MINECARTSPAWNER: case MT_MINECARTSPAWNER:
if (!player->bot && (special->fuse < TICRATE || player->powers[pw_carry] != CR_MINECART)) if (player->bot)
{ return;
mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART); if (special->fuse > TICRATE)
P_SetTarget(&mcart->target, toucher); return;
mcart->angle = toucher->angle = player->drawangle = special->angle; if (player->powers[pw_carry] == CR_MINECART)
mcart->friction = FRACUNIT; return;
mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART);
P_SetTarget(&mcart->target, toucher);
mcart->angle = toucher->angle = player->drawangle = special->angle;
mcart->friction = FRACUNIT;
P_ResetPlayer(player); P_ResetPlayer(player);
player->pflags |= PF_JUMPDOWN; player->pflags |= PF_JUMPDOWN;
player->powers[pw_carry] = CR_MINECART; player->powers[pw_carry] = CR_MINECART;
player->pflags &= ~PF_APPLYAUTOBRAKE; player->pflags &= ~PF_APPLYAUTOBRAKE;
P_SetTarget(&toucher->tracer, mcart); P_SetTarget(&toucher->tracer, mcart);
toucher->momx = toucher->momy = toucher->momz = 0; toucher->momx = toucher->momy = toucher->momz = 0;
special->fuse = 3*TICRATE; special->fuse = 3*TICRATE;
special->flags2 |= MF2_DONTDRAW; special->flags2 |= MF2_DONTDRAW;
}
return; return;
case MT_MINECARTEND: case MT_MINECARTEND: