Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing

Members: 0
Guests: 2
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » AFKMud Bugfix List » AFKMud Bug Archive » [Bug] Mobs can wander and fle...
Forum Rules | Mark all | Recent Posts

[Bug] Mobs can wander and flee through window exits and death traps
< Newer Topic :: Older Topic > AFKMud 1.77

Pages:<< prev 1 next >>
Post is unread #1 May 27, 2006, 11:05 am   Last edited May 27, 2006, 11:07 am by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Mobs can wander and flee through window exits and death traps
Danger: Low - Annoyance mostly.
Discovered in: AFKMud 1.77
Found by: Remcon
Fixed by: Remcon

---

update.c, mobile_update

Locate:
      /*
       * Wander 
       */
      /*
       * Update hunt_victim also if any changes are made here 
       */
      if( !IS_ACT_FLAG( ch, ACT_SENTINEL )
          && !IS_ACT_FLAG( ch, ACT_PROTOTYPE )
          && ( door = number_bits( 5 ) ) <= 9 && ( pexit = get_exit( ch->in_room, door ) ) != NULL && pexit->to_room
          /*
           * && !IS_EXIT_FLAG( pexit, EX_CLOSED ) - Test to see if mobs will open doors like this. 
           */
          && !IS_EXIT_FLAG( pexit, EX_NOMOB )
          /*
           * Keep em from wandering through my walls, Marcus 
           */
          && !IS_EXIT_FLAG( pexit, EX_FORTIFIED )
          && !IS_EXIT_FLAG( pexit, EX_HEAVY )
          && !IS_EXIT_FLAG( pexit, EX_MEDIUM )
          && !IS_EXIT_FLAG( pexit, EX_LIGHT )
          && !IS_EXIT_FLAG( pexit, EX_CRUMBLING )
          && !IS_ROOM_FLAG( pexit->to_room, ROOM_NO_MOB )
          && !IS_ROOM_FLAG( pexit->to_room, ROOM_DEATH )
          && ( !IS_ACT_FLAG( ch, ACT_STAY_AREA ) || pexit->to_room->area == ch->in_room->area ) )
      {


Change to:
      /*
       * Wander 
       */
      /*
       * Update hunt_victim also if any changes are made here 
       */
      if( !IS_ACT_FLAG( ch, ACT_SENTINEL )
          && !IS_ACT_FLAG( ch, ACT_PROTOTYPE )
          && ( door = number_bits( 5 ) ) <= 9 && ( pexit = get_exit( ch->in_room, door ) ) != NULL && pexit->to_room
          /*
           * && !IS_EXIT_FLAG( pexit, EX_CLOSED ) - Test to see if mobs will open doors like this. 
           */
          && !IS_EXIT_FLAG( pexit, EX_WINDOW )
          && !IS_EXIT_FLAG( pexit, EX_NOMOB )
          /*
           * Keep em from wandering through my walls, Marcus 
           */
          && !IS_EXIT_FLAG( pexit, EX_FORTIFIED )
          && !IS_EXIT_FLAG( pexit, EX_HEAVY )
          && !IS_EXIT_FLAG( pexit, EX_MEDIUM )
          && !IS_EXIT_FLAG( pexit, EX_LIGHT )
          && !IS_EXIT_FLAG( pexit, EX_CRUMBLING )
          && !IS_ROOM_FLAG( pexit->to_room, ROOM_NO_MOB )
          && !IS_ROOM_FLAG( pexit->to_room, ROOM_DEATH )
          && ( !IS_ACT_FLAG( ch, ACT_STAY_AREA ) || pexit->to_room->area == ch->in_room->area ) )
      {


Locate:
      /*
       * Flee 
       */
      if( ch->hit < ch->max_hit / 2
          && ( door = number_bits( 4 ) ) <= 9
          && ( pexit = get_exit( ch->in_room, door ) ) != NULL
          && pexit->to_room && !IS_EXIT_FLAG( pexit, EX_CLOSED ) && !IS_EXIT_FLAG( pexit, EX_NOMOB )
          /*
           * Keep em from wandering through my walls, Marcus 
           */
          && !IS_EXIT_FLAG( pexit, EX_FORTIFIED )
          && !IS_EXIT_FLAG( pexit, EX_HEAVY )
          && !IS_EXIT_FLAG( pexit, EX_MEDIUM )
          && !IS_EXIT_FLAG( pexit, EX_LIGHT )
          && !IS_EXIT_FLAG( pexit, EX_CRUMBLING ) && !IS_ROOM_FLAG( pexit->to_room, ROOM_NO_MOB ) )


Chage to:
      /*
       * Flee 
       */
      if( ch->hit < ch->max_hit / 2
          && ( door = number_bits( 4 ) ) <= 9
          && ( pexit = get_exit( ch->in_room, door ) ) != NULL
          && pexit->to_room && !IS_EXIT_FLAG( pexit, EX_CLOSED ) && !IS_EXIT_FLAG( pexit, EX_NOMOB )
          && !IS_EXIT_FLAG( pexit, EX_WINDOW )
          /*
           * Keep em from wandering through my walls, Marcus 
           */
          && !IS_EXIT_FLAG( pexit, EX_FORTIFIED )
          && !IS_EXIT_FLAG( pexit, EX_HEAVY )
          && !IS_EXIT_FLAG( pexit, EX_MEDIUM )
          && !IS_EXIT_FLAG( pexit, EX_LIGHT )
          && !IS_EXIT_FLAG( pexit, EX_CRUMBLING ) && !IS_ROOM_FLAG( pexit->to_room, ROOM_NO_MOB ) 
          && !IS_ROOM_FLAG( pexit->to_room, ROOM_DEATH ) )


The first one adds in so mobs don't try to exit through a window and the second makes it so they dont try to flee through a window or into a death trap. Mobs should not generally be able to pass into either one.
       
Pages:<< prev 1 next >>