From cf7abe9e92bb8ee9ad3d07f05003177e60fc7d43 Mon Sep 17 00:00:00 2001 From: Theriaca Date: Sun, 1 Apr 2018 18:11:12 +0200 Subject: allow building on movers update buildable origin when moved --- src/game/g_buildable.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index a65f2a0..164bbcf 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2915,6 +2915,8 @@ void G_BuildableThink( gentity_t *ent, int msec ) //fall back on normal physics routines G_Physics( ent, msec ); + + VectorCopy(ent->r.currentOrigin, ent->s.origin); } @@ -3420,13 +3422,13 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance if( !( normal[ 2 ] >= minNormal || ( invert && normal[ 2 ] <= -minNormal ) ) ) reason = IBE_NORMAL; - if( tr1.entityNum != ENTITYNUM_WORLD ) - reason = IBE_NORMAL; - // check nobuild zones if( nobuild_check( entity_origin ) >= 0 ) reason = IBE_PERMISSION; + if( tr1.entityNum != ENTITYNUM_WORLD && g_entities[ tr1.entityNum ].s.eType != ET_MOVER ) + reason = IBE_NORMAL; + contents = trap_PointContents( entity_origin, -1 ); if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) -- cgit