Differences From Artifact [df6f0d84fe]:
- File
src/Monster.m
— part of check-in
[304230c1e1]
at
2025-03-23 21:52:54
on branch trunk
— Avoid pointless pointers
Passing OFVector3D by reference is annoying and is worse at passing via registers. (user: js, size: 13359) [annotate] [blame] [check-ins using]
To Artifact [9674185459]:
- File src/Monster.m — part of check-in [75095b4f6e] at 2025-03-23 22:14:48 on branch trunk — Fix wrong argument order for calculating distance (user: js, size: 13359) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
268 269 270 271 272 273 274 | } else { self.yaw -= curtime * 0.5f; if (self.targetYaw > self.yaw) self.yaw = self.targetYaw; } float disttoenemy = | | | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | } else { self.yaw -= curtime * 0.5f; if (self.targetYaw > self.yaw) self.yaw = self.targetYaw; } float disttoenemy = OFDistanceOfVectors3D(self.enemy.origin, self.origin); self.pitch = atan2(self.enemy.origin.z - self.origin.z, disttoenemy) * 180 / PI; // special case: if we run into scenery if (self.blocked) { self.blocked = false; // try to jump over obstackle (rare) |
︙ | ︙ | |||
466 467 468 469 470 471 472 | if (lastmillis - monster.lastAction < 2000) { monster.move = 0; moveplayer(monster, 1, false); } } else { v.z += monster.eyeHeight; float dist = | | | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | if (lastmillis - monster.lastAction < 2000) { monster.move = 0; moveplayer(monster, 1, false); } } else { v.z += monster.eyeHeight; float dist = OFDistanceOfVectors3D(v, monster.origin); v.z -= monster.eyeHeight; if (dist < 4) teleport(i, monster); } } }]; |
︙ | ︙ |