You're using engine, so it's a little bit different than my example. Originally I didn't understand the difference between
pev_absmin and
pev_mins but now I think I do.
pev_absmin contains the coordinates with respect to (0.0, 0.0, 0.0)
pev_mins contains the coordinates with respect to the entity's origin
When you are doing this:
Code:
entity_set_size(ent, mins, maxs)
It's equivalent to using fakemeta like this:
Code:
set_pev(ent, pev_mins, mins)
set_pev(ent, pev_maxs, maxs)
So you should use coordinates with respect to the entity's origin when you set its size with
entity_set_size(). However, you should use coordinates with respect to (0.0, 0.0, 0.0) when you are drawing the box with
write_byte(31); // TE_BOX.
By the way, you should use "TE_BOX" instead of "31", it should be defined already. It's always better to avoid hard-coding when you can.