Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[12109] Add file to handle vehicle related opcodes

Also fixed a stupid typo from recent commit. Thx to dbauz for pointing

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
  • Loading branch information...
commit c10d5fb49617354f13948d83fa09ef8fa0ad0d2a 1 parent c1bdd66
Andreas authored August 21, 2012 Schmoozerd committed August 21, 2012
18  src/game/MovementHandler.cpp
@@ -404,24 +404,6 @@ void WorldSession::HandleMoveNotActiveMoverOpcode(WorldPacket& recv_data)
404 404
     _player->m_movementInfo = mi;
405 405
 }
406 406
 
407  
-void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data)
408  
-{
409  
-    DEBUG_LOG("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
410  
-    recv_data.hexlike();
411  
-
412  
-    ObjectGuid guid;
413  
-    MovementInfo mi;
414  
-
415  
-    recv_data >> guid.ReadAsPacked();
416  
-    recv_data >> mi;
417  
-
418  
-    ObjectGuid vehicleGUID = _player->GetCharmGuid();
419  
-    if (!vehicleGUID)                                       // something wrong here...
420  
-        return;
421  
-
422  
-    _player->m_movementInfo = mi;
423  
-}
424  
-
425 407
 void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/)
426 408
 {
427 409
     // DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM");
4  src/game/Player.cpp
@@ -4330,7 +4330,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
4330 4330
 
4331 4331
 void Player::SetRoot(bool enable)
4332 4332
 {
4333  
-    WorldPacket data(enable ? SMSG_FORCE_MOVE_ROOT : SMSG_FORCE_MOVE_UNROOT, GetPackGUID().size() + 4));
  4333
+    WorldPacket data(enable ? SMSG_FORCE_MOVE_ROOT : SMSG_FORCE_MOVE_UNROOT, GetPackGUID().size() + 4);
4334 4334
     data << GetPackGUID();
4335 4335
     data << uint32(0);
4336 4336
     GetSession()->SendPacket(&data);
@@ -4338,7 +4338,7 @@ void Player::SetRoot(bool enable)
4338 4338
 
4339 4339
 void Player::SetWaterWalk(bool enable)
4340 4340
 {
4341  
-    WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4));
  4341
+    WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, GetPackGUID().size() + 4);
4342 4342
     data << GetPackGUID();
4343 4343
     data << uint32(0);
4344 4344
     GetSession()->SendPacket(&data);
45  src/game/VehicleHandler.cpp
... ...
@@ -0,0 +1,45 @@
  1
+/*
  2
+ * Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
  3
+ *
  4
+ * This program is free software; you can redistribute it and/or modify
  5
+ * it under the terms of the GNU General Public License as published by
  6
+ * the Free Software Foundation; either version 2 of the License, or
  7
+ * (at your option) any later version.
  8
+ *
  9
+ * This program is distributed in the hope that it will be useful,
  10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12
+ * GNU General Public License for more details.
  13
+ *
  14
+ * You should have received a copy of the GNU General Public License
  15
+ * along with this program; if not, write to the Free Software
  16
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  17
+ */
  18
+
  19
+#include "Common.h"
  20
+#include "WorldPacket.h"
  21
+#include "WorldSession.h"
  22
+#include "Opcodes.h"
  23
+#include "ObjectGuid.h"
  24
+#include "Log.h"
  25
+#include "Player.h"
  26
+#include "Vehicle.h"
  27
+#include "ObjectMgr.h"
  28
+
  29
+void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data)
  30
+{
  31
+    DEBUG_LOG("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
  32
+    recv_data.hexlike();
  33
+
  34
+    ObjectGuid guid;
  35
+    MovementInfo mi;
  36
+
  37
+    recv_data >> guid.ReadAsPacked();
  38
+    recv_data >> mi;
  39
+
  40
+    ObjectGuid vehicleGUID = _player->GetCharmGuid();
  41
+    if (!vehicleGUID)                                       // something wrong here...
  42
+        return;
  43
+
  44
+    _player->m_movementInfo = mi;
  45
+}
2  src/shared/revision_nr.h
... ...
@@ -1,4 +1,4 @@
1 1
 #ifndef __REVISION_NR_H__
2 2
 #define __REVISION_NR_H__
3  
- #define REVISION_NR "12108"
  3
+ #define REVISION_NR "12109"
4 4
 #endif // __REVISION_NR_H__
1  win/VC100/game.vcxproj
@@ -498,6 +498,7 @@
498 498
     <ClCompile Include="..\..\src\game\Unit.cpp" />
499 499
     <ClCompile Include="..\..\src\game\UpdateData.cpp" />
500 500
     <ClCompile Include="..\..\src\game\Vehicle.cpp" />
  501
+    <ClCompile Include="..\..\src\game\VehicleHandler.cpp" />
501 502
     <ClCompile Include="..\..\src\game\VoiceChatHandler.cpp" />
502 503
     <ClCompile Include="..\..\src\game\WaypointManager.cpp" />
503 504
     <ClCompile Include="..\..\src\game\WaypointMovementGenerator.cpp" />
3  win/VC100/game.vcxproj.filters
@@ -249,6 +249,9 @@
249 249
     <ClCompile Include="..\..\src\game\UpdateData.cpp">
250 250
       <Filter>World/Handlers</Filter>
251 251
     </ClCompile>
  252
+    <ClCompile Include="..\..\src\game\VehicleHandler.cpp">
  253
+      <Filter>World/Handlers</Filter>
  254
+    </ClCompile>
252 255
     <ClCompile Include="..\..\src\game\VoiceChatHandler.cpp">
253 256
       <Filter>World/Handlers</Filter>
254 257
     </ClCompile>
4  win/VC90/game.vcproj
@@ -1035,6 +1035,10 @@
1035 1035
 				>
1036 1036
 			</File>
1037 1037
 			<File
  1038
+				RelativePath="..\..\src\game\VehicleHandler.cpp"
  1039
+				>
  1040
+			</File>
  1041
+			<File
1038 1042
 				RelativePath="..\..\src\game\VoiceChatHandler.cpp"
1039 1043
 				>
1040 1044
 			</File>

15 notes on commit c10d5fb

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 21, 2012

author - zergtmn, 2,5 year ago...
PS this also has similate errors, as source patch...

Sergey

it's just moving code from one place to another. how errors are possible there?

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 21, 2012

received guid not used, but must. his may be not equal current charmGuid (different reactions), also some events must be resulted of this opcode...

Schmoozerd

obviously this comment was about creating a placeholder and fix some stupid typos.

So there never was any intention at all to implement any opcode with this commit

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 22, 2012

Very original method for creating placeholder - move wrong and bugged code from one place to another :) Please forgive my stupidity, I did not think that you are so joking :)

Schmoozerd

You are aleays free to keep your notions to yourself.

Vladimir

rsa, from good style work with git repo this is good commit. If part file moved to new file then better code move do without changes as possible. Also this let add project files updates independent from code changes. That is also good for clear changes view.

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 23, 2012

Владимир, не берите на душу. Мне уже довольно давно надоело воевать с мельницами, поэтому я больше прикалываюсь. (сейчас так вообще вся энергия ушла в -tree. возможно это и хорошо. хотя и втыкивание патчей с трехлетней историей тоже наверное плюс... хз...) Хотя логика тут сильно хромает - уж делать плейсхолдер, так чистый, а не с дремучими ошибками тянущимися ХЗ сколько времени...

Vladimir

Создание плейсхолдера - часто техническая операция переноса того что туда должно уйти - причем тут ошибки - главное некий критерий сортировки что к нему относиться и все. Исправление ошибок для других коммитов. Не вижу повода для приколов. Он например нужен в том числе как подготовительный шаг добавления одно из реализаций.

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 23, 2012

Вот и надо было бы добавить чистый плейсхолдер, без кода и без ошибок. Именно как плейсхолдер для дальнейшей работы. Не было бы повода прикалываться. Насчет добавления реализаций - я не вижу что можно добавить рабочего из бранча kid10, там все настолько замшелое (как этот плейсхолдер :) что жуть. Впрочем это все равно не мое дело...

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 23, 2012

@Schmoozerd , something told that you leave the project. Pity, can hardly now be somewhere to find another leader ... I'm a long time did not take you too seriously, perhaps it was not too good behavior. If something offended - I apologize. Good luck!

cyberium

I confirm you can be rude :). But i don't think you have any responsability here.

Сергей AKA /dev/rsa
rsa commented on c10d5fb August 23, 2012

I do not expect an answer. As for the rudeness - I agree, but this is just a reflection of the real character (I'm pretty much over all of mangos members, I have quite unintelligent profession and into the bargain too quiet places of work in the past).

Schmoozerd

@rsa Do not worry at all :)
Though I didn't enjoy all of your comments you did usually comment about content which I respected and often considered important feedback.
Me not continuouing here has nothing to do with you nor your actions at all.

@Schmoozerd may we know why ? if you don't mind of course, kinda sad to see you leave :(.

Please sign in to comment.
Something went wrong with that request. Please try again.