| 1126 | } |
| 1127 | |
| 1128 | bool cb_ray_hits_ent::operator()(xEnt& ent, xGridBound& gridb) |
| 1129 | { |
| 1130 | xCollis c; |
| 1131 | |
| 1132 | if (!(ent.chkby & chkby)) |
| 1133 | { |
| 1134 | return true; |
| 1135 | } |
| 1136 | |
| 1137 | if (!(ent.collType & collType)) |
| 1138 | { |
| 1139 | return true; |
| 1140 | } |
| 1141 | |
| 1142 | c.flags = coll.flags; |
| 1143 | |
| 1144 | xRayHitsBound(&ray, &ent.bound, &c); |
| 1145 | |
| 1146 | if (!(c.flags & 0x1)) |
| 1147 | { |
| 1148 | return true; |
| 1149 | } |
| 1150 | |
| 1151 | if (c.dist > coll.dist) |
| 1152 | { |
| 1153 | return true; |
| 1154 | } |
| 1155 | |
| 1156 | if (ent.collLev == 0x5) |
| 1157 | { |
| 1158 | iRayHitsModel(&ray, ent.model, &c); |
| 1159 | |
| 1160 | if (!(c.flags & 0x1)) |
| 1161 | { |
| 1162 | return true; |
| 1163 | } |
| 1164 | |
| 1165 | if (c.dist > coll.dist) |
| 1166 | { |
| 1167 | return true; |
| 1168 | } |
| 1169 | } |
| 1170 | |
| 1171 | memcpy(&coll, &c, sizeof(xCollis)); |
| 1172 | |
| 1173 | coll.oid = ent.id; |
| 1174 | coll.optr = &ent; |
| 1175 | coll.mptr = ent.model; |
| 1176 | |
| 1177 | return true; |
| 1178 | } |
| 1179 | |
| 1180 | void xEntEnable(xEnt* ent) |
| 1181 | { |
nothing calls this directly
no test coverage detected