Thread: Movement Speed?
View Single Post
Old July 8, 2021, 21:11   #54
Join Date: Sep 2016
Posts: 53
NCountr is on a distinguished road
Wand of Clone Monster bug

The wand only works when the mob is awake. If that is a new feature, I'm behind the times. But, it used to work regardless of mob state in 3.x.

In Project-mob.c -
/* Attempt to clone. */
if (multiply_monster(cave, context->mon))
context->hurt_msg = MON_MSG_SPAWN;

--- does not seem to work because, of bool sleep in mon-make.c's code:
* If `sleep` is true, the monster is placed with its default sleep value,
* which is given in monster.txt.
... */
bool place_new_monster(struct chunk *c, struct loc grid,
struct monster_race *race, bool sleep, bool group_ok,
struct monster_group_info group_info, byte origin)
In this case, if the mob is already asleep, the wand of clone monster successfully speeds up the mob, but does not clone it because the mob is asleep and generate.c cannot place a "wake", cloned mob asleep in a grid square. So, I believe the line in mon-move.c -
bool multiply_monster(struct chunk *c, const struct monster *mon)
simply returns FALSE without dropping a new mob or a dump file to debug. Good code, possibly faulty logic.
NCountr is offline   Reply With Quote