mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-20 10:31:45 +01:00
New Group System, Room Events, and Event System Efficiency Upgrade... and a couple bug fixes.
This commit is contained in:
13
src/genwld.c
13
src/genwld.c
@@ -17,6 +17,7 @@
|
||||
#include "genzon.h"
|
||||
#include "shop.h"
|
||||
#include "dg_olc.h"
|
||||
#include "mud_event.h"
|
||||
|
||||
|
||||
/* This function will copy the strings so be sure you free your own copies of
|
||||
@@ -167,6 +168,16 @@ int delete_room(room_rnum rnum)
|
||||
extract_script(room, WLD_TRIGGER);
|
||||
free_proto_script(room, WLD_TRIGGER);
|
||||
|
||||
if (room->events != NULL) {
|
||||
if (room->events->iSize > 0) {
|
||||
struct event * pEvent;
|
||||
|
||||
while ((pEvent = simple_list(room->events)) != NULL)
|
||||
event_cancel(pEvent);
|
||||
}
|
||||
free_list(room->events);
|
||||
}
|
||||
|
||||
/* Change any exit going to this room to go the void. Also fix all the exits
|
||||
* pointing to rooms above this. */
|
||||
i = top_of_world + 1;
|
||||
@@ -378,10 +389,12 @@ int copy_room(struct room_data *to, struct room_data *from)
|
||||
free_room_strings(to);
|
||||
*to = *from;
|
||||
copy_room_strings(to, from);
|
||||
to->events = from->events;
|
||||
|
||||
/* Don't put people and objects in two locations. Should this be done here? */
|
||||
from->people = NULL;
|
||||
from->contents = NULL;
|
||||
from->events = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user