- sv = it.origin;
- sv.x = bound(sm1_x, sv.x, sm2_x);
- sv.y = bound(sm1_y, sv.y, sm2_y);
- sv.z = bound(sm1_z, sv.z, sm2_z);
- ev = this.origin;
- em1 = it.origin + it.mins;
- em2 = it.origin + it.maxs;
- ev.x = bound(em1_x, ev.x, em2_x);
- ev.y = bound(em1_y, ev.y, em2_y);
- ev.z = bound(em1_z, ev.z, em2_z);
+
+ vector sv2;
+ float sv2_height;
+ if (this.wpisbox)
+ {
+ sv = it.origin;
+ sv.x = bound(sm1.x, sv.x, sm2.x);
+ sv.y = bound(sm1.y, sv.y, sm2.y);
+ sv.z = bound(sm1.z, sv.z, sm2.z);
+ sv2.x = sv.x;
+ sv2.y = sv.y;
+ sv2.z = sm1.z;
+ sv2_height = sm2.z - sm1.z;
+ }
+ else
+ {
+ sv = this.origin;
+ sv2 = sv;
+ sv2_height = 0;
+ }
+
+ vector ev2;
+ float ev2_height;
+ if (it.wpisbox)
+ {
+ ev = this.origin;
+ em1 = it.origin + it.mins;
+ em2 = it.origin + it.maxs;
+ ev.x = bound(em1.x, ev.x, em2.x);
+ ev.y = bound(em1.y, ev.y, em2.y);
+ ev.z = bound(em1.z, ev.z, em2.z);
+ ev2.x = ev.x;
+ ev2.y = ev.y;
+ ev2.z = em1.z;
+ ev2_height = em2.z - em1.z;
+ }
+ else
+ {
+ ev = it.origin;
+ ev2 = ev;
+ ev2_height = 0;
+ }
+