[Code improvement] Minor Improvement and Edit to command Tele Delete

Old Command script:


static bool HandleTeleDelCommand(ChatHandler* handler, const char* args)

{

	 if (!*args)

		 return false;

	 std::string name = args;

	 if (!sObjectMgr->DeleteGameTele(name))

	 {

		 handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);

		 handler->SetSentErrorMessage(true);

		 return false;

	 }

	 handler->SendSysMessage(LANG_COMMAND_TP_DELETED);

	 return true;

}

New Command script:


static bool HandleTeleDelCommand(ChatHandler* handler, const char* args)

{

	 if (!*args)

		 return false;


// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r

	 GameTele const* tele = handler->extractGameTeleFromLink((char*)args);

if (!tele)

{

handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);

		 handler->SetSentErrorMessage(true);

		 return false;

}

	 std::string name = tele->name;

sObjectMgr->DeleteGameTele(name);

	 handler->SendSysMessage(LANG_COMMAND_TP_DELETED);

	 return true;

}

What this does:

This just adds the possibility of deleting a teleport location using its ID, Name.

The command script was just ignored, thats why no one ever made it this way lol.

Tested and working perfectly, all cases.

Poeple can now use .tele del NAME or .tele del ID

By the way, where do i go about requesting the adition of more enhancments to current trinitycode?

Aka, have my changes commited if they are valued good?

https://help.github.com/articles/using-pull-requests that should help you

(open Trinity’s pull requests are in https://github.com/TrinityCore/TrinityCore/pulls)

Yes, but i am not welling to put my core online.

Would be amazing if i could post enhancment code, and they get integrated into the project.

EDIT: Pull Request created!

Hopefully i will contribute more as i see where it needs enhancment!