Menu

#484 world.citylife no longer loads / works

open
nobody
None
5
2026-06-25
2026-06-24
Rick Tanner
No

Opening a ticket on this to avoid the issue getting lost in the discord/irc scroll back.

It was reported (thank you, Cloak) that citylife did not appear to be working. Further investigation confirmed something was broken.

More details to following.

Discussion

  • Rick Tanner

    Rick Tanner - 2026-06-24

    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.

     
  • Rick Tanner

    Rick Tanner - 2026-06-24

    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 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.

     
  • Rick Tanner

    Rick Tanner - 2026-06-24

    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

     
  • Rick Tanner

    Rick Tanner - 2026-06-25

    Test server build using git hash 1d264775ed

    • 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.

     
  • Rick Tanner

    Rick Tanner - 2026-06-25

    $ patch -p1 --dry-run < cfcitybell-close-fix.patch
    checking file server/modules/cfcitybell.cpp

     

Log in to post a comment.

MongoDB Logo MongoDB