Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Today, 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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
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, Sogou, Google

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » do_rescue lets ch rescue vict...
Forum Rules | Mark all | Recent Posts

do_rescue lets ch rescue victim fighting ch... With bad results
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 13, 2006, 5:39 am
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

As a gag the other day on a MUD I frequent, I thought I'd have a look and see if I could get myself out of a fight by trying to rescue my attacker. This did not go so well... It worked, but I can safely say that I took too long to realize I was kicking my ass.

This presents two problems, one which I have the fix for.

In skills.c, in function do_rescue(), find the following:

   if( ( fch = who_fighting( victim ) ) == NULL )
   {
      send_to_char( "They are not fighting right now.\r\n", ch );
      return;
   }

   ch->alignment = ch->alignment + 5;
   ch->alignment = URANGE( -1000, ch->alignment, 1000 );


Directly BEFORE that, add the following:

   if( ( fch = who_fighting( victim ) ) == ch )
   {
	   send_to_char( "One would imagine THEY don't need your help.\r\n", ch );
	   return;
   }


The second problem is... Why are multi_hit and one_hit allowing ch == victim? That makes no sense. I'm not sure about set_fighting... I don't think it should allow ch == victim, but I'm not absolutely sure about it. Damage should probably be the only such function that allows ch == victim... You shouldn't be able to carry a round of combat against yourself. That just seems absurd to me.
       
Post is unread #2 Mar 13, 2006, 7:47 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Smaugfuss luckly already has a check in do_rescue for victim == ch and who_fighting( victim ) == ch.
From the looks of it, the others you mentioned probably would allow ch == victim lol.
I'll just let samson fiqure out the best possible fix for them lol, personaly I'd go with in each part that I thought shouldn't allow it having a check to protect it.
       
Pages:<< prev 1 next >>