InternetHackContain.cpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: InternetHackContain.cpp //////////////////////////////////////////////////////////////////////
  24. // Author: Graham Smallwood, June 2003
  25. // Desc: Contain module that just gives aiHackInternet command to passengers
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. // USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
  28. #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
  29. #include "GameLogic/Module/InternetHackContain.h"
  30. #include "GameLogic/Object.h"
  31. #include "GameLogic/Module/AIUpdate.h"
  32. #ifdef _INTERNAL
  33. // for occasional debugging...
  34. //#pragma optimize("", off)
  35. //#pragma MESSAGE("************************************** WARNING, optimization disabled for debugging purposes")
  36. #endif
  37. // ------------------------------------------------------------------------------------------------
  38. // ------------------------------------------------------------------------------------------------
  39. InternetHackContainModuleData::InternetHackContainModuleData()
  40. {
  41. }
  42. // ------------------------------------------------------------------------------------------------
  43. // ------------------------------------------------------------------------------------------------
  44. void InternetHackContainModuleData::buildFieldParse(MultiIniFieldParse& p)
  45. {
  46. TransportContainModuleData::buildFieldParse(p);
  47. static const FieldParse dataFieldParse[] =
  48. {
  49. { 0, 0, 0, 0 }
  50. };
  51. p.add(dataFieldParse);
  52. }
  53. // PRIVATE ////////////////////////////////////////////////////////////////////////////////////////
  54. // PUBLIC /////////////////////////////////////////////////////////////////////////////////////////
  55. //-------------------------------------------------------------------------------------------------
  56. //-------------------------------------------------------------------------------------------------
  57. InternetHackContain::InternetHackContain( Thing *thing, const ModuleData *moduleData ) :
  58. TransportContain( thing, moduleData )
  59. {
  60. }
  61. //-------------------------------------------------------------------------------------------------
  62. //-------------------------------------------------------------------------------------------------
  63. InternetHackContain::~InternetHackContain( void )
  64. {
  65. }
  66. //-------------------------------------------------------------------------------------------------
  67. //-------------------------------------------------------------------------------------------------
  68. void InternetHackContain::onContaining( Object *rider, Bool wasSelected )
  69. {
  70. TransportContain::onContaining( rider, wasSelected );
  71. if( rider->getAI() )
  72. rider->getAI()->aiHackInternet(CMD_FROM_AI);
  73. }
  74. // ------------------------------------------------------------------------------------------------
  75. /** CRC */
  76. // ------------------------------------------------------------------------------------------------
  77. void InternetHackContain::crc( Xfer *xfer )
  78. {
  79. // extend base class
  80. TransportContain::crc( xfer );
  81. } // end crc
  82. // ------------------------------------------------------------------------------------------------
  83. /** Xfer method
  84. * Version Info:
  85. * 1: Initial version */
  86. // ------------------------------------------------------------------------------------------------
  87. void InternetHackContain::xfer( Xfer *xfer )
  88. {
  89. // version
  90. XferVersion currentVersion = 1;
  91. XferVersion version = currentVersion;
  92. xfer->xferVersion( &version, currentVersion );
  93. // extend base class
  94. TransportContain::xfer( xfer );
  95. } // end xfer
  96. // ------------------------------------------------------------------------------------------------
  97. /** Load post process */
  98. // ------------------------------------------------------------------------------------------------
  99. void InternetHackContain::loadPostProcess( void )
  100. {
  101. // extend base class
  102. TransportContain::loadPostProcess();
  103. } // end loadPostProcess