View Single Post
  #1  
Old 05-03-2010, 03:49 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default Saylink's Crashing Zone on No Target Fix

Now I had a problem on my server which obviously isn't released yet, but with the amount saylinks that we have that aren't silent causing zone crashes were blowing up on recent revisions.

This is just a general fix that Secrets helped with and now saylinks no longer crash zones without a target, and of course still function normally.

Code:
Index: client.cpp
===================================================================
--- client.cpp	(revision 1451)
+++ client.cpp	(working copy)
@@ -737,7 +737,8 @@
 	if (targetname == NULL) {
 		targetname = (!GetTarget()) ? NULL : GetTarget()->GetName();
 	}
-
+if(targetname)
+{
 	if(RuleB(Chat, EnableAntiSpam))
 	{
 		if(strcmp(targetname, "discard") != 0)
@@ -758,7 +759,7 @@
 				
 				if(RuleI(Chat, MinStatusToBypassAntiSpam) <= Admin())
 					AllowedMessages = 10000;
-
+				
 				AttemptedMessages++;
 				if(AttemptedMessages > AllowedMessages)
 				{
@@ -782,6 +783,7 @@
 			}
 		}
 	}
+	}
 
 	switch(chan_num)
 	{
Reply With Quote