DG Scripts bug fixes (#44)

* Increase ID space

DG Scripts uses tiny idspace that results in wacky bugs when the mud is
running too long.

* Overhaul script ids

All references to GET_ID(ch/obj) were removed and replaced by
char_script_id() and obj_script_id(), which don’t assign ids until they
are needed. The ch->id and obj->id variable names were changed to
script_id to prevent accidental errors for future programmers. This
change greatly increases how long the mud can run before it runs out of
ID space.

* Fix extraction count

This prevents an error log where it has over-counted the extractions
pending. It now behaves correctly when the same mob is %purge%’d or
extract_char()’d twice.
This commit is contained in:
Paul Clarke 2018-02-15 12:06:35 -07:00 committed by wyld-sw
parent d7a50664ea
commit 41da68bdb0
14 changed files with 182 additions and 125 deletions

View file

@ -1254,9 +1254,9 @@ int enter_player_game (struct descriptor_data *d)
load_room = r_frozen_start_room;
/* copyover */
GET_ID(d->character) = GET_IDNUM(d->character);
d->character->script_id = GET_IDNUM(d->character);
/* find_char helper */
add_to_lookup_table(GET_ID(d->character), (void *)d->character);
add_to_lookup_table(d->character->script_id, (void *)d->character);
/* After moving saving of variables to the player file, this should only
* be called in case nothing was found in the pfile. If something was