From e192d8f39b85ef504762bcbbd5c13a9885510f6b Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 14 Jun 2009 09:57:57 -0500 Subject: *Some work on vehicle. --HG-- branch : trunk --- src/game/Debugcmds.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/game/Debugcmds.cpp') diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index 2e432ab1c0f..d8b94df4e10 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -763,10 +763,17 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args) char* e = strtok((char*)args, " "); char* i = strtok(NULL, " "); - if (!e || !i) + if (!e) return false; uint32 entry = (uint32)atoi(e); + + float x, y, z, o = m_session->GetPlayer()->GetOrientation(); + m_session->GetPlayer()->GetClosePoint(x, y, z, m_session->GetPlayer()->GetObjectSize()); + + if(!i) + return m_session->GetPlayer()->SummonVehicle(entry, x, y, z, o); + uint32 id = (uint32)atoi(i); CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry); @@ -781,8 +788,6 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args) Vehicle *v = new Vehicle; Map *map = m_session->GetPlayer()->GetMap(); - float x, y, z, o = m_session->GetPlayer()->GetOrientation(); - m_session->GetPlayer()->GetClosePoint(x, y, z, m_session->GetPlayer()->GetObjectSize()); if(!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam(), x, y, z, o)) { -- cgit v1.2.3