Skip to content

Commit

Permalink
rename FillBoxMinMax to BoxPointsToMinsMaxs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtldg committed Oct 2, 2024
1 parent ee0fe65 commit f96a574
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions addons/sourcemod/scripting/shavit-zones.sp
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,7 @@ public any Native_AddZone(Handle plugin, int numParams)
}
}

// normalize zone points...
FillBoxMinMax(cache.fCorner1, cache.fCorner2, cache.fCorner1, cache.fCorner2);
BoxPointsToMinsMaxs(cache.fCorner1, cache.fCorner2, cache.fCorner1, cache.fCorner2);

gA_ZoneCache[gI_MapZones] = cache;

Expand Down Expand Up @@ -3995,7 +3994,8 @@ public bool TraceFilter_World(int entity, int contentsMask)
return (entity == 0);
}

void FillBoxMinMax(float point1[3], float point2[3], float boxmin[3], float boxmax[3])
// Sometimes our points aren't mins/maxs... sometimes old DB points... which is not good...
void BoxPointsToMinsMaxs(float point1[3], float point2[3], float boxmin[3], float boxmax[3])
{
for (int i = 0; i < 3; i++)
{
Expand Down Expand Up @@ -4041,7 +4041,7 @@ bool InStartOrEndZone(float point1[3], float point2[3], int track, int type)

if (box)
{
FillBoxMinMax(point1, point2, amin, amax);
BoxPointsToMinsMaxs(point1, point2, amin, amax);
}

for (int i = 0; i < gI_MapZones; i++)
Expand All @@ -4053,7 +4053,7 @@ bool InStartOrEndZone(float point1[3], float point2[3], int track, int type)
}

float bmin[3], bmax[3];
FillBoxMinMax(gV_MapZones_Visual[i][0], gV_MapZones_Visual[i][7], bmin, bmax);
BoxPointsToMinsMaxs(gV_MapZones_Visual[i][0], gV_MapZones_Visual[i][7], bmin, bmax);

if (box)
{
Expand Down Expand Up @@ -4510,8 +4510,7 @@ void InsertZone(int client)
GetTrackName(LANG_SERVER, c.iTrack, sTrack, sizeof(sTrack));
GetZoneName(LANG_SERVER, c.iType, sZoneName, sizeof(sZoneName));

// normalize zone points...
FillBoxMinMax(c.fCorner1, c.fCorner2, c.fCorner1, c.fCorner2);
BoxPointsToMinsMaxs(c.fCorner1, c.fCorner2, c.fCorner1, c.fCorner2);

Reset(client);

Expand Down

0 comments on commit f96a574

Please sign in to comment.