Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
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, Yandex, Bing

Members: 0
Guests: 8
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 » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Player only and ooc com...
Forum Rules | Mark all | Recent Posts

[Bug] Player only and ooc command flags don't actually do anything
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 16, 2009, 11:41 am   Last edited Jan 16, 2009, 11:52 am by Keberus
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Bug: Player only and ooc command flags don't actually do anything
Danger: High - Code may not work as expect and could result in a crash
Found by: Ayuri/Keberus
Fixed by: Keberus

---


interp.c, interpret

Locate:
   if( ch->desc && ch->desc->snoop_by )
   {
      sprintf( logname, "%s", ch->name );
      write_to_buffer( ch->desc->snoop_by, logname, 0 );
      write_to_buffer( ch->desc->snoop_by, "% ", 2 );
      write_to_buffer( ch->desc->snoop_by, logline, 0 );
      write_to_buffer( ch->desc->snoop_by, "\r\n", 2 );
   }


Below that add:
    bool check = TRUE;

    if( cmd && IS_CMDFLAG( cmd, CMD_OOC ) )
        check = FALSE;


Locate:
  if( cmd && timer && str_cmp( command, "ooc" ) )


Change to:
  if( check && timer )


Locate:
      if( cmd && IS_NPC( ch ) && IS_AFFECTED( ch, AFF_CHARM ) && IS_CMD_MPROG( cmd ) )
      {
         send_to_char( "You can't do that while charmed!\r\n", ch );
         return;
      }


After that add:
      if( cmd && IS_NPC( ch ) && IS_CMDFLAG( cmd, CMD_PLR_ONLY ) )
      {
         send_to_char( "Only player's can use this command!\r\n", ch );
         return;
      }



mud.h
Locate:
#define IS_CMD_MPROG(cmd)          (IS_SET( (cmd)->flags, CMD_MUDPROG) )


After that add:
#define IS_CMDFLAG( cmd, flag )    ( IS_SET( (cmd)->flags, (flag) ) )



This fix will make any command flagged ooc not interrupt people with timers (people making things). The other part of this fix will allow Imms to flag commands as player_only to stop mobs from being able to use them, which is easier than adding that if( IS_NPC(ch) ) check everywhere.
       
Pages:<< prev 1 next >>