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, DotBot, Google, Yandex, Yahoo!, Majestic-12

Members: 0
Guests: 10
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 » SWFOTE FUSS » Npc's can use commands they s...
Forum Rules | Mark all | Recent Posts

Npc's can use commands they shouldn't
< Newer Topic :: Older Topic > Some will crash. Others won't.

Pages:<< prev 1 next >>
Post is unread #1 Jan 15, 2009, 5:23 pm
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

I found this while working on pets/slaves for my code. It seems those before myself have put in a lot of safeguards against the ordering of npc's about, however some have been overlooked. I'll update this topic as I find them.

In ships.c function do_ordership (thats what buyship points to)
Add in this for your first if statement:
   if( IS_NPC( ch ) || !ch->pcdata )
   {
      send_to_char( "&ROnly players can do that!\r\n", ch );
      return;
   }


In space.c function do_salvage
Add this in for your first if statement:
  if( IS_NPC( ch ) || !ch->pcdata )
   {
      send_to_char( "&ROnly players can do that!\r\n", ch );
      return;
   }


This next one has me slightly confused - would like any input the community may have.
In act_comm.c function do_beep:
   if( !IS_NPC( ch ) && ( IS_SET( ch->act, PLR_SILENCE ) || IS_SET( ch->act, PLR_NO_TELL ) ) )
   {
      send_to_char( "You can't do that.\r\n", ch );
      return;
   }

   if( !IS_NPC( ch ) && IS_SET( ch->pcdata->act2, ACT_GAGGED ) )
   {
      send_to_char( "You can't say anything! You're gagged!\r\n", ch );
      return;
   }


Could we not change the above to something like
if( IS_NPC( ch ) || IS_SET ??? or would it be best to have a whole new if statement ruling out npc's?

Ayuri
       
Post is unread #2 Jan 16, 2009, 1:04 am
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

Showing my stupidity here - I was talking to Keberus and sounds like with swfotefuss 1.4 command flags you can set commands to player only.
But if anyone is interested in what else npc's can do let me know and I'll continue to dig.

Ayuri
       
Post is unread #3 Jan 16, 2009, 11:51 am
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Yeah well, they didn't actually work until I just fixed them. It's all good now though.
       
Pages:<< prev 1 next >>