ref: b9330833b6185fb909fef5cf9948d6e35fc2fe71
parent: 95500fd01f3fb268fb7524a188a833927d045767
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Jan 5 20:36:57 EST 2024
SV_FindTouchedLeafs: rearrange
--- a/world.c
+++ b/world.c
@@ -298,21 +298,23 @@
int sides;
int leafnum;
- if(node->contents == CONTENTS_SOLID)
- return 0;
+ if(node->contents == 0){
+ splitplane = node->plane;
+ sides = BOX_ON_PLANE_SIDE(ent->v.absmin, ent->v.absmax, splitplane);
- if(node->contents < 0){
- leafnum = (mleaf_t*)node - sv.worldmodel->leafs - 1;
- return pvs[leafnum>>3] & (1<<(leafnum&7));
+ return
+ ((sides & 1) && SV_FindTouchedLeafs(ent, node->children[0], pvs)) ||
+ ((sides & 2) && SV_FindTouchedLeafs(ent, node->children[1], pvs));
}
- splitplane = node->plane;
- sides = BOX_ON_PLANE_SIDE(ent->v.absmin, ent->v.absmax, splitplane);
+ if(node->contents == CONTENTS_SOLID)
+ return 0;
- return
- ((sides & 1) && SV_FindTouchedLeafs(ent, node->children[0], pvs)) ||
- ((sides & 2) && SV_FindTouchedLeafs(ent, node->children[1], pvs));
+ leafnum = (mleaf_t*)node - sv.worldmodel->leafs - 1;
+ return pvs[leafnum>>3] & (1<<(leafnum&7));
}
+
+
/*
===============