diff options
author | Mikko Tiusanen <ams@daug.net> | 2015-02-21 16:14:19 +0200 |
---|---|---|
committer | Mikko Tiusanen <ams@daug.net> | 2015-02-21 16:14:19 +0200 |
commit | ce866de2e0814fbc73797aac333d8d51ed1d17b8 (patch) | |
tree | 4ff72c3aa0bd15afd8c34a19dadec5fbfc2bf811 /src/game/g_buildable.c | |
parent | 8222c5a05274a77b3f4873738565e0ca4bc94295 (diff) |
Enable credit/evo gain from killing buildables.
Allow building within own om/rc radius even if enemy creeps/refineries nearby.
Renamed the mod files from edge to new edge.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r-- | src/game/g_buildable.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index dbe1f1d..22e8376 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -322,7 +322,7 @@ buildable_t G_IsPowered( vec3_t origin ) return BA_NONE; } - /* +/* ================ G_IsGathered @@ -4190,6 +4190,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance qboolean invert; int contents; playerState_t *ps = &ent->client->ps; + float d; // Stop all buildables from interacting with traces //G_SetBuildableLinkState( qfalse ); @@ -4257,7 +4258,13 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance break; case 2: // Creeps/colonies block building for enemy team if( G_IsGathered( TEAM_HUMANS, entity_origin, qfalse, ent ) ) - reason = IBE_BLOCKEDBYENEMY; + { + tempent = G_Overmind( ); + if( tempent != NULL ) { + d = Distance( tempent->s.origin, entity_origin ); + if ( d > CREEP_BASESIZE ) reason = IBE_BLOCKEDBYENEMY; + } else reason = IBE_BLOCKEDBYENEMY; + } break; default: if( G_IsPowered( entity_origin ) != BA_NONE ) @@ -4305,7 +4312,13 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance reason = IBE_BLOCKEDBYENEMY; case 2: // Creeps/colonies block building for enemy team if( G_IsGathered( TEAM_ALIENS, entity_origin, qfalse, ent ) ) - reason = IBE_BLOCKEDBYENEMY; + { + tempent = G_Reactor( ); + if( tempent != NULL ) { + d = Distance( tempent->s.origin, entity_origin ); + if ( d > REACTOR_BASESIZE ) reason = IBE_BLOCKEDBYENEMY; + } else reason = IBE_BLOCKEDBYENEMY; + } break; default: if( G_IsCreepHere( entity_origin ) ) |