Confusing code fix (#76)

* Make sure all followers are free'd before freeing the character list

Otherwise, the followers structs will point to free'd memory and
the stop_follower call will attempt to dereference a free'd
characters' followers list.

* Make sure %target% works in act triggers

* code cleanup. Remove inline block, make variable names more understandable.

Ref https://www.tbamud.com/forum/4-development/4525-confused-over-piece-of-code-in-parse-room
This commit is contained in:
Thomas Arp
2020-01-26 22:19:10 +01:00
committed by wyld-sw
parent 1ab51a0545
commit 7f0acefcb4
2 changed files with 21 additions and 12 deletions

View File

@@ -2495,7 +2495,7 @@ void perform_act(const char *orig, struct char_data *ch, struct obj_data *obj,
const char *i = NULL;
char lbuf[MAX_STRING_LENGTH], *buf, *j;
bool uppercasenext = FALSE;
struct char_data *dg_victim = NULL;
struct char_data *dg_victim = (to == vict_obj) ? vict_obj : NULL;
struct obj_data *dg_target = NULL;
char *dg_arg = NULL;