Closed jedso closed 1 year ago
As an aside, I did wonder if having
height
be constantly set to half the bbox height is really the desired behavior. E.g. ifshavit_zones_box_offset = 0
, why should distance_z be offset by half the bbox height yet have no offset for distance_x/y?
Yeah, I think you're right about it not being desired/expected/optimal with shavit_zones_box_offset = 0
.
I'll add a commit for it to this PR and then merge this in.
I'll add a commit for it to this PR and then merge this in.
Or should I? Also I wonder if it'd be better to just make the convar a boolean and hardcode the offset per game...
Also I wonder if it'd be better to just make the convar a boolean and hardcode the offset per game...
Not a bad idea. Guess it depends how much control you want to give people. I guess 3 main solutions for this:
bbox / 2
like you say (for most people this should be fine)(shavit_zones_box_offset / bbox width) * bbox height
). Allows people to set offsets other than 0 or bbox / 2
shavit_zones_box_offset
as a decimal fraction float where the default value = 0.5, then use that with bbox_width/height to get offsetsEnded up adding a commit to make it act like a bool & to do the height too. I'm not going to squash merge it right now so I can stare at it for a bit longer
TF2's bounding box is
48x48x82
compared to CS:S32x32x62
and CS:GO32x32x72
. As such, the default value of gCV_BoxOffset (bbox width / 2) is slightly off the player's center for TF2.In SetZoneMinsMaxs, the
height
variable is half the bbox height but does not use the correct value for TF2 either (uses CS:S 62.0 instead of 82.0). This PR adds the correct bbox values for TF2.As an aside, I did wonder if having
height
be constantly set to half the bbox height is really the desired behavior. E.g. ifshavit_zones_box_offset = 0
, why should distance_z be offset by half the bbox height yet have no offset for distance_x/y?https://github.com/shavitush/bhoptimer/blob/a6da4358de06937b095dcafd79050e4ea937844a/addons/sourcemod/scripting/shavit-zones.sp#L5104-L5114