diff options
author | aap <aap@papnet.eu> | 2020-05-05 23:27:43 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-05 23:27:43 +0200 |
commit | 68d3ea9c42f985077d34174f937dbf520d9493e8 (patch) | |
tree | 8ab10b1aacea87ed8dde3b172e4a00fae51eb4a3 /src/core/Zones.cpp | |
parent | Fix appveyour (diff) | |
download | re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.gz re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.bz2 re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.lz re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.xz re3-68d3ea9c42f985077d34174f937dbf520d9493e8.tar.zst re3-68d3ea9c42f985077d34174f937dbf520d9493e8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/Zones.cpp | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp index 804708b4..d30f3718 100644 --- a/src/core/Zones.cpp +++ b/src/core/Zones.cpp @@ -139,7 +139,11 @@ CTheZones::CreateZone(char *name, eZoneType type, for(p = name; *p; p++) if(islower(*p)) *p = toupper(*p); // add zone - zone = &ZoneArray[TotalNumberOfZones++]; +// TODO(MIAMI): do this properly, also navig zones + if(type == ZONE_MAPZONE) + zone = &MapZoneArray[TotalNumberOfMapZones++]; + else + zone = &ZoneArray[TotalNumberOfZones++]; strncpy(zone->name, name, 7); zone->name[7] = '\0'; zone->type = type; @@ -157,36 +161,6 @@ CTheZones::CreateZone(char *name, eZoneType type, } void -CTheZones::CreateMapZone(char *name, eZoneType type, - float minx, float miny, float minz, - float maxx, float maxy, float maxz, - eLevelName level) -{ - CZone *zone; - char *p; - - if(minx > maxx) SWAPF(minx, maxx); - if(miny > maxy) SWAPF(miny, maxy); - if(minz > maxz) SWAPF(minz, maxz); - - // make upper case - for(p = name; *p; p++) if(islower(*p)) *p = toupper(*p); - - // add zone - zone = &MapZoneArray[TotalNumberOfMapZones++]; - strncpy(zone->name, name, 7); - zone->name[7] = '\0'; - zone->type = type; - zone->minx = minx; - zone->miny = miny; - zone->minz = minz; - zone->maxx = maxx; - zone->maxy = maxy; - zone->maxz = maxz; - zone->level = level; -} - -void CTheZones::PostZoneCreation(void) { int i; @@ -565,18 +539,6 @@ CTheZones::FindAudioZone(CVector *pos) return -1; } -eLevelName -CTheZones::FindZoneForPoint(const CVector &pos) -{ - if(PointLiesWithinZone(pos, GetZone(FindZoneByLabelAndReturnIndex("IND_ZON")))) - return LEVEL_INDUSTRIAL; - if(PointLiesWithinZone(pos, GetZone(FindZoneByLabelAndReturnIndex("COM_ZON")))) - return LEVEL_COMMERCIAL; - if(PointLiesWithinZone(pos, GetZone(FindZoneByLabelAndReturnIndex("SUB_ZON")))) - return LEVEL_SUBURBAN; - return LEVEL_NONE; -} - void CTheZones::AddZoneToAudioZoneArray(CZone *zone) { |