Jump to content

Super jail stuff


comix
 Share

Recommended Posts

[== c++ ==]
+    ObjectGuid GUID = sObjectMgr.GetPlayerGuidByName(cname.c_str());  
+   /* if (GUID == 0)  
+    {  
+        SendSysMessage(LANG_JAIL_WRONG_NAME);  
+        return true;  
+    }*/                                                /// commented out to restore build 5/13/2011 -- wrong name on jail search wont show till fixed

Link to comment
Share on other sites

it's not work , i fix Crash in Unjail but in jail still crash :

fix crash in Unjail :

@@ -2062,11 +2066,11 @@ bool ChatHandler::HandleUnJailCommand(char *args)

chr->CastSpell(chr,8690,false);

//chr->GetSession()->LogoutPlayer(false);

} else PSendSysMessage(LANG_JAIL_CHAR_NOTJAILED, cname.c_str());

return true;

}

- else

+ else if (!GUID == 0)

{

CharacterDatabase.BeginTransaction();

QueryResult *jresult = CharacterDatabase.PQuery("SELECT * FROM `jail` WHERE `guid`='%u' LIMIT 1", chr->GetGUIDLow());

CharacterDatabase.CommitTransaction();

@@ -2098,11 +2102,15 @@ bool ChatHandler::HandleUnJailCommand(char *args)

delete jresult;

return true;

}

}

+ else

+ {

+ SendSysMessage(LANG_JAIL_WRONG_NAME);

return true;

+ }

}

//Send mail by command

bool ChatHandler::HandleSendMailCommand(char* args)

{

Link to comment
Share on other sites

else if (!GUID == 0) should be else if (GUID != 0)

Thing is that the code does not check if the user exists before it starts running the code for jailing the player that does not exist

ObjectGuid GUID = sObjectMgr.GetPlayerGuidByName(cname.c_str());

if (GUID == 0)

{

SendSysMessage(LANG_JAIL_WRONG_NAME);

return true;

}

This is correct code as i can read, maby you shall just comment the line SendSysMessage(LANG_JAIL_WRONG_NAME); and instead use

PSendSysMessage("The name does not exist go bang yo mom");

- LilleCarl

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use