Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
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
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Remcon

Members: 1
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Grenades again...
Forum Rules | Mark all | Recent Posts

Grenades again...
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 10, 2006, 10:24 am   Last edited May 10, 2006, 10:42 am by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Honestly, did anyone think this feature through AT ALL? It's absolutely ridiculous. Stock, if you arm a grenade, hand it to somebody, and, say, move two or three areas away, guess where it's going to detonate? Right where you are. The person holding gets the "EXPLODES" message, of course, but you take all the damage. Why? Because apparently, they did almost no testing for this at all. I really fail to see how something like this could go unchecked, but it's not really anyone's fault, and there's certainly no sense ranting about it. Meh.

Anyway, the fix. In handler.c, in function explode(), find:

            if( obj->carried_by )
            {
               act( AT_WHITE, "$p EXPLODES in $n's hands!", obj->carried_by, obj, NULL, TO_ROOM );
               act( AT_WHITE, "$p EXPLODES in your hands!", obj->carried_by, obj, NULL, TO_CHAR );
               room = xch->in_room;
               held = TRUE;
            }


Change that to:

            if( obj->carried_by )
            {
               act( AT_WHITE, "$p EXPLODES in $n's hands!", obj->carried_by, obj, NULL, TO_ROOM );
               act( AT_WHITE, "$p EXPLODES in your hands!", obj->carried_by, obj, NULL, TO_CHAR );
               room = obj->carried_by->in_room;
               held = TRUE;
            }


The problem was that when it searches to make sure the person who armed the grenade didn't log to save his butt or whatever, if it finds the grenade is being held by somebody, it sends messages properly, but sets the room as xch->in_room... Which makes no sense at all, unless handing somebody an armed grenade was illegal and this was some sick form of payback (Which I doubt).

Also, when I downloaded a stock copy of SWR FUSS, I came to realize... The thing with the explosion messages in room_explode1? I posted the wrong line. That was out of another codebase I had been working on where I had started to fix it, didn't quite finish it, before using a stock copy to get the job done and make sure none of my personal changes were made to it. Basically, the one ya'll have is just going to spam the first person in the room incessantly, instead of just the entire room. XD

Here's the REAL fix. In handler.c, in function room_explode1(), locate:

      rnext = rch->next_in_room;
      act( AT_WHITE, "The shockwave from a massive explosion rips through your body!", room->first_person, obj, NULL,
           TO_CHAR );
      dam = number_range( obj->value[0], obj->value[1] );


Change that to:

      rnext = rch->next_in_room;
      act( AT_WHITE, "The shockwave from a massive explosion rips through your body!", rch, obj, NULL,
           TO_CHAR );
      dam = number_range( obj->value[0], obj->value[1] );


And NOW it will behave the way it's supposed to... Maybe. Frankly, I tossed the stock exploding handler and just wrote my own, because God knows what else will reveal itself as not working properly if I didn't. At least if I wrote my own code, I'd know how it works and know how to fix it when a problem arises. But whatever. Anyway, there ya'll go.
       
Post is unread #2 Jun 29, 2006, 12:28 am
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Just while I have a moment, thought I'd "bump" this one up quick. This one HAS to be causing someone a headache somewhere.
       
Pages:<< prev 1 next >>