bool check_social( CHAR_DATA *ch, CHAR_DATA *victim )
{
if( is_ignoring(ch, victim) ) <– What causes this to occur?
return FALSE;
if( something() ) <– What causes this to occur?
return FALSE;
return TRUE;
}
bool check_social (CHAR_DATA * ch, char *command, char *argument)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int cmd;
bool found;
found = FALSE;
for (cmd = 0; social_table[cmd].name[0] != '\0'; cmd++)
{
if (command[0] == social_table[cmd].name[0]
&& !str_prefix (command, social_table[cmd].name))
found = TRUE;
break;
}
if (!found)
return FALSE;
if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
send_to_char ("You are anti-social!\n\r", ch);
return TRUE;
switch (ch->position)
{
case POS_DEAD:
send_to_char ("Lie still; you are DEAD.\n\r", ch);
return TRUE;
case POS_INCAP:
case POS_MORTAL:
send_to_char ("You are hurt far too bad for that.\n\r", ch);
return TRUE;
case POS_STUNNED:
send_to_char ("You are too stunned to do that.\n\r", ch);
return TRUE;
case POS_SLEEPING:
/*
* I just know this is the path to a 12" 'if' statement. :(
* But two players asked for it already! – Furey
*/
if (!str_cmp (social_table[cmd].name, "snore"))
break;
send_to_char ("In your dreams, or what?\n\r", ch);
return TRUE;
}
}
if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
send_to_char ("You are anti-social!\n\r", ch);
return TRUE;
if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
{ send_to_char ("You are anti-social!\n\r", ch);
return TRUE;
}
/*
* The main entry point for executing commands.
* Can be recursively called from 'at', 'order', 'force'.
*/
void interpret (CHAR_DATA * ch, char *argument)
{
char command[MAX_INPUT_LENGTH];
char logline[MAX_INPUT_LENGTH];
int cmd;
int trust;
bool found;
/*
* Strip leading spaces.
*/
while (isspace (*argument))
argument++;
if (argument[0] == '\0')
return;
/*
* No hiding.
*/
REMOVE_BIT (ch->affected_by, AFF_HIDE);
/*
* Implement freeze command.
*/
if (!IS_NPC (ch) && IS_SET (ch->act, PLR_FREEZE))
{
send_to_char ("You're totally frozen!\n\r", ch);
return;
}
/*
* Grab the command word.
* Special parsing so ' can be a command,
* also no spaces needed after punctuation.
*/
strcpy (logline, argument);
if (!isalpha (argument[0]) && !isdigit (argument[0]))
{
command[0] = argument[0];
command[1] = '\0';
argument++;
while (isspace (*argument))
argument++;
}
else
{
argument = one_argument (argument, command);
}
/*
* Look for command in command table.
*/
found = FALSE;
trust = get_trust (ch);
for (cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++)
{
if (command[0] == cmd_table[cmd].name[0]
&& !str_prefix (command, cmd_table[cmd].name)
&& cmd_table[cmd].level <= trust)
{
found = TRUE;
break;
}
}
/*
* Log and snoop.
*/
smash_dollar(logline);
if (cmd_table[cmd].log == LOG_NEVER)
strcpy (logline, "");
/* Replaced original block of code with fix from Edwin
* to prevent crashes due to dollar signs in logstrings.
* I threw in the above call to smash_dollar() just for
* the sake of overkill :) JR – 10/15/00
*/
if ( ( !IS_NPC(ch) && IS_SET(ch->act, PLR_LOG) )
|| fLogAll
|| cmd_table[cmd].log == LOG_ALWAYS )
{
char s[2*MAX_INPUT_LENGTH],*ps;
int i;
ps=s;
sprintf( log_buf, "Log %s: %s", ch->name, logline );
/* Make sure that was is displayed is what is typed */
for (i=0;log_buf[i];i++)
{
*ps++=log_buf[i];
if (log_buf[i]=='$')
*ps++='$';
if (log_buf[i]=='{')
*ps++='{';
}
*ps=0;
wiznet(s,ch,NULL,WIZ_SECURE,0,get_trust(ch));
log_string( log_buf );
}
if (ch->desc != NULL && ch->desc->snoop_by != NULL)
{
write_to_buffer (ch->desc->snoop_by, "% ", 2);
write_to_buffer (ch->desc->snoop_by, logline, 0);
write_to_buffer (ch->desc->snoop_by, "\n\r", 2);
}
if (!found)
{
/*
* Look for command in socials table.
*/
if (!check_social (ch, command, argument))
send_to_char ("Huh?\n\r", ch);
return;
}
/*
* Character not in position for command?
*/
if (ch->position < cmd_table[cmd].position)
{
switch (ch->position)
{
case POS_DEAD:
send_to_char ("Lie still; you are DEAD.\n\r", ch);
break;
case POS_MORTAL:
case POS_INCAP:
send_to_char ("You are hurt far too bad for that.\n\r", ch);
break;
case POS_STUNNED:
send_to_char ("You are too stunned to do that.\n\r", ch);
break;
case POS_SLEEPING:
send_to_char ("In your dreams, or what?\n\r", ch);
break;
case POS_RESTING:
send_to_char ("Nah… You feel too relaxed…\n\r", ch);
break;
case POS_SITTING:
send_to_char ("Better stand up first.\n\r", ch);
break;
case POS_FIGHTING:
send_to_char ("No way! You are still fighting!\n\r", ch);
break;
}
return;
}
/*
* Dispatch the command.
*/
(*cmd_table[cmd].do_fun) (ch, argument);
tail_chain ();
return;
}
{
found = TRUE;
break;
}
found = TRUE;
break;
Socials no longer work. At all. Like none. All one would get is 'Huh?' which is the default when a social can't be found via check_social(). I haven't changed anything in social.are to cause it to fail. Social.are loads fine, apparently…but nothing happens except the 'Huh?' I've gotten so used to seeing now. Nothing I've done in code (all I'm doing is putting in my own version of ignore which is in a file by itself and I've removed it by rename and all occurrences of do_ignore and is_ignoring from the other files and that still didn't do anything).
I've re-downloaded Quickmud, put it in a directory by itself and compared all the files via diff to see where social loaded and went through line by line and accounted for everything that I might've changed or whatnot. Nothing touched load_socials or check_social so now I'm completely lost. Am I missing something here? Any help would be greatly appreciated. Thanks in advance.