Split monster goal coordinate out of mstrategy field

Instead of packing a coordinate into unsigned long, store the goal in
a coord struct, making the code a bit cleaner.  Monster struct is
of course slightly bigger, but that should not really matter.
No change in monster behaviour.

Breaks saves and bones.
This commit is contained in:
Pasi Kallinen
2025-02-16 10:35:17 +02:00
parent 8672807a5e
commit 3cb7819c81
4 changed files with 21 additions and 18 deletions

View File

@@ -1750,8 +1750,8 @@ m_move(struct monst *mtmp, int after)
if (is_covetous(ptr)) { /* [should this include
* '&& mtmp->mstrategy != STRAT_NONE'?] */
int covetousattack;
coordxy tx = STRAT_GOALX(mtmp->mstrategy),
ty = STRAT_GOALY(mtmp->mstrategy);
coordxy tx = mtmp->mgoal.x,
ty = mtmp->mgoal.y;
struct monst *intruder = isok(tx, ty) ? m_at(tx, ty) : NULL;
/*
* if there's a monster on the object or in possession of it,