I've been tinkering again and think I've broke it.
Basically, when a certain champion dies, I've overridden your sys_character_die function with my own. I have an additional check in there that it isn't a "npc", say, and if so I deposit their rotten corpse not only on the ground, but also remove their portrait as well. The dsb_champion_fromparty function only works on living characters, as far as I can tell, and not deceased ones... I tested it on two chars, removing the living one when the other one died and it was no problem.
Example code, pasted at the end of the function
Code: Select all
-- Remove XXXX from party
dsb_champion_fromparty(ppos)
PROGRAM ERROR!
Reason: Removed nonexistent (from all)
Stack Dump:
DSBmain
DSBgameloop
run_timers
lua.dsb_champion_fromparty
remove_from_all_pos