found a unit with weird position values on one of my maps (negative and in the thousands) it didn't appear in the animal stocks screen, but looked completely fine otherwise (alive, tame, own, etc) maybe a rare bug, but better avoid assigning such units to zones or slaughter etc.
| 625 | // it didn't appear in the animal stocks screen, but looked completely fine otherwise (alive, tame, own, etc) |
| 626 | // maybe a rare bug, but better avoid assigning such units to zones or slaughter etc. |
| 627 | static bool hasValidMapPos(df::unit *unit) { |
| 628 | return unit->pos.x >= 0 && unit->pos.y >= 0 && unit->pos.z >= 0 |
| 629 | && unit->pos.x < world->map.x_count |
| 630 | && unit->pos.y < world->map.y_count |
| 631 | && unit->pos.z < world->map.z_count; |
| 632 | } |
| 633 | |
| 634 | // built cage in a zone (supposed to detect zoo cages) |
| 635 | static bool isInBuiltCageRoom(df::unit *unit) { |
no outgoing calls
no test coverage detected