mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-08 02:48:26 +00:00
don't do zone offset stuff on mins/maxs if the offset is bigger than the zone's x/y half-distance
xc_fox_shrine_japan_v1 will crash if i make a 16unit zone at the top (maybe elsewhere too?) so that's why this was added.
This commit is contained in:
parent
6952bab715
commit
39c9d96924
@ -3877,15 +3877,30 @@ public void CreateZoneEntities(bool only_create_dead_entities)
|
|||||||
float height = ((IsSource2013(gEV_Type))? 62.0:72.0) / 2;
|
float height = ((IsSource2013(gEV_Type))? 62.0:72.0) / 2;
|
||||||
|
|
||||||
float min[3];
|
float min[3];
|
||||||
min[0] = -distance_x + gCV_BoxOffset.FloatValue;
|
min[0] = -distance_x;
|
||||||
min[1] = -distance_y + gCV_BoxOffset.FloatValue;
|
min[1] = -distance_y;
|
||||||
min[2] = -distance_z + height;
|
min[2] = -distance_z + height;
|
||||||
SetEntPropVector(entity, Prop_Send, "m_vecMins", min);
|
|
||||||
|
|
||||||
float max[3];
|
float max[3];
|
||||||
max[0] = distance_x - gCV_BoxOffset.FloatValue;
|
max[0] = distance_x;
|
||||||
max[1] = distance_y - gCV_BoxOffset.FloatValue;
|
max[1] = distance_y;
|
||||||
max[2] = distance_z - height;
|
max[2] = distance_z - height;
|
||||||
|
|
||||||
|
float offset = gCV_BoxOffset.FloatValue;
|
||||||
|
|
||||||
|
if (distance_x > offset)
|
||||||
|
{
|
||||||
|
min[0] += offset;
|
||||||
|
max[0] -= offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (distance_y > offset)
|
||||||
|
{
|
||||||
|
min[1] += offset;
|
||||||
|
max[1] -= offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetEntPropVector(entity, Prop_Send, "m_vecMins", min);
|
||||||
SetEntPropVector(entity, Prop_Send, "m_vecMaxs", max);
|
SetEntPropVector(entity, Prop_Send, "m_vecMaxs", max);
|
||||||
|
|
||||||
SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
|
SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user