Citylife is silently non-functional since commit a2f180417. The initialization
order swap moved init_modules() to after load_assets(), so the .citylife
zone-data hook is registered too late and no town NPC zones are ever loaded.
A secondary latent crash (null pointer in add_npc_to_point) has existed since
the function was first written but was never reachable because of the primary bug.
Citylife is working; numerous NPCs walking around Scorn
CityBells is working, "You hear the various temples of Scorn"
I am getting an alert for the following though.
cfcitybell_close() calls all_regions.clear() instead of regions.clear().
all_regions is the server-wide game region list; clearing it on module
shutdown destroys all region data in memory. The module's own map is
named regions and that is what should be cleared after freeing its values.
Attached patch via Claude to address this issue.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My attempts at testing:
Reverted server code back to 12e86359c from 2026-Apr-27 and citylife is not working
Citylife is not working with c99b8f49e from 2025-Aug-26
It looks like the issue has been a problem for quite some time.
I consulted Claude and it provided the following - snippet of info from the Code session, See patch and summary file for more details.
Citylife Module — Bug Investigation Summary
Date: 2026-06-24
Repo: crossfire-crossfire-server
Branch: master (HEAD: c17b49753)
TL;DR
Citylife is silently non-functional since commit
a2f180417. The initializationorder swap moved
init_modules()to afterload_assets(), so the.citylifezone-data hook is registered too late and no town NPC zones are ever loaded.
A secondary latent crash (null pointer in
add_npc_to_point) has existed sincethe function was first written but was never reachable because of the primary bug.
Patch test info:
$ patch -p1 --dry-run < fix-init-order.patch
checking file include/modules.h
checking file server/init.cpp
checking file server/modules/citylife.cpp
$ patch -p1 --dry-run < fix-null-ptr-add-npc-to-point.patch
checking file server/modules/citylife.cpp
$ patch -p1 --dry-run < fix-object-free-flags.patch
checking file server/modules/citylife.cpp
Test server build using git hash 1d264775ed
I am getting an alert for the following though.
cfcitybell_close() calls all_regions.clear() instead of regions.clear().
all_regions is the server-wide game region list; clearing it on module
shutdown destroys all region data in memory. The module's own map is
named regions and that is what should be cleared after freeing its values.
Attached patch via Claude to address this issue.
$ patch -p1 --dry-run < cfcitybell-close-fix.patch
checking file server/modules/cfcitybell.cpp