UpdateMask.h
上传用户:jxpjxmjjw
上传日期:2009-12-07
资源大小:5877k
文件大小:14k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. // Copyright (C) 2004 Team Python
  2. //  
  3. // This program is free software; you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation; either version 2 of the License, or
  6. // (at your option) any later version.
  7. // 
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. // GNU General Public License for more details.
  12. // 
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software 
  15. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. #ifndef WOWPYTHONSERVER_UPDATEMASKS_H
  17. #define WOWPYTHONSERVER_UPDATEMASKS_H
  18. #define UPDATE_BLOCKS 864
  19. #define UNIT_BLOCKS 5
  20. #define PLAYER_BLOCKS 27
  21. //  List of Indices
  22. //  Commented out fields basically are just placeholders showing how many bits between good Index enums
  23. enum ObjectUpdateFields {
  24. OBJECT_START = 0,
  25. OBJECT_FIELD_GUID = 0 + OBJECT_START,
  26. OBJECT_FIELD_TYPE = 2 + OBJECT_START,
  27. OBJECT_FIELD_ENTRY = 3 + OBJECT_START,
  28. OBJECT_FIELD_SCALE_X = 4 + OBJECT_START,
  29. OBJECT_FIELD_PADDING = 5 + OBJECT_START,
  30. OBJECT_END = 6 + OBJECT_START,
  31. };
  32. enum ItemUpdateFields {
  33. ITEM_START = OBJECT_END,
  34. ITEM_FIELD_OWNER = 0x00 + ITEM_START,
  35. ITEM_FIELD_CONTAINED = 0x02 + ITEM_START,
  36. ITEM_FIELD_CREATOR = 0x04 + ITEM_START,
  37. ITEM_FIELD_GIFTCREATOR = 0x06 + ITEM_START,
  38. ITEM_FIELD_STACK_COUNT = 0x08 + ITEM_START,
  39. ITEM_FIELD_DURATION = 0x09 + ITEM_START,
  40. ITEM_FIELD_SPELL_CHARGES = 0x0A + ITEM_START,
  41. ITEM_FIELD_FLAGS = 0x0F + ITEM_START,
  42. ITEM_FIELD_ENCHANTMENT = 0x10 + ITEM_START,
  43. ITEM_FIELD_PROPERTY_SEED = 0x25 + ITEM_START,
  44. ITEM_FIELD_RANDOM_PROPERTIES_ID = 0x26 + ITEM_START,
  45. ITEM_FIELD_ITEM_TEXT_ID = 0x27 + ITEM_START,
  46. ITEM_DURABILITY = 0x28 + ITEM_START,
  47. ITEM_MAXDURABILITY = 0x29 + ITEM_START,
  48. ITEM_END = 0x2A + ITEM_START,
  49. };
  50. enum ContainerUpdateFields {
  51. CONTAINER_START = ITEM_END,
  52. CONTAINER_FIELD_NUM_SLOTS = 0x00 + CONTAINER_START,
  53. CONTAINER_ALIGN_PAD = 0x01 + CONTAINER_START,
  54. CONTAINER_FIELD_SLOT_1 = 0x02 + CONTAINER_START,
  55. CONTAINER_END = 0x2A + CONTAINER_START,
  56. };
  57. enum UnitUpdateFields {
  58. UNIT_START = OBJECT_END,
  59. UNIT_FIELD_CHARM = 0x00 + UNIT_START, //2
  60. UNIT_FIELD_SUMMON = 0x02 + UNIT_START, //2
  61. UNIT_FIELD_CHARMEDBY = 0x04 + UNIT_START, //2
  62. UNIT_FIELD_SUMMONEDBY = 0x06 + UNIT_START, //2
  63. UNIT_FIELD_CREATEDBY = 0x08 + UNIT_START, //2
  64. UNIT_FIELD_TARGET = 0x00A + UNIT_START, //2
  65. UNIT_FIELD_CHANNEL_OBJECT = 0x00C + UNIT_START, //2
  66. UNIT_FIELD_HEALTH = 0x00E + UNIT_START, //1
  67. UNIT_FIELD_POWER1 = 0x00F + UNIT_START, //1
  68. UNIT_FIELD_POWER2 = 0x010 + UNIT_START, //1
  69. UNIT_FIELD_POWER3 = 0x011 + UNIT_START, //1
  70. UNIT_FIELD_POWER4 = 0x012 + UNIT_START, //1
  71. UNIT_FIELD_POWER5 = 0x013 + UNIT_START, //1
  72. UNIT_FIELD_MAXHEALTH = 0x014 + UNIT_START, //1
  73. UNIT_FIELD_MAXPOWER1 = 0x015 + UNIT_START, //1
  74. UNIT_FIELD_MAXPOWER2 = 0x016 + UNIT_START, //1
  75. UNIT_FIELD_MAXPOWER3 = 0x017 + UNIT_START, //1
  76. UNIT_FIELD_MAXPOWER4 = 0x018 + UNIT_START, //1
  77. UNIT_FIELD_MAXPOWER5 = 0x019 + UNIT_START, //1
  78. UNIT_FIELD_LEVEL = 0x01A + UNIT_START, //1
  79. UNIT_FIELD_FACTIONTEMPLATE = 0x01B + UNIT_START, //1
  80. UNIT_FIELD_BYTES_0 = 0x01C + UNIT_START, //1
  81. UNIT_VIRTUAL_ITEM_SLOT_DISPLAY = 0x01D + UNIT_START, //3
  82. UNIT_VIRTUAL_ITEM_INFO = 0x020 + UNIT_START, //6
  83. UNIT_FIELD_FLAGS = 0x026 + UNIT_START, //1
  84. UNIT_FIELD_AURA   = 0x027 + UNIT_START, //38h
  85. UNIT_FIELD_AURALEVELS = 0x05F + UNIT_START, //0Ah
  86. UNIT_FIELD_AURAAPPLICATIONS = 0x069 + UNIT_START, //0Ah
  87. UNIT_FIELD_AURAFLAGS = 0x073 + UNIT_START, //7
  88. UNIT_FIELD_AURASTATE = 0x07A + UNIT_START, //1
  89. UNIT_FIELD_BASEATTACKTIME = 0x07B + UNIT_START, //2
  90. UNIT_FIELD_BOUNDINGRADIUS = 0x07D + UNIT_START, //1
  91. UNIT_FIELD_COMBATREACH = 0x07E + UNIT_START, //1
  92. UNIT_FIELD_DISPLAYID = 0x07F + UNIT_START, //1
  93. UNIT_FIELD_NATIVEDISPLAYID = 0x080 + UNIT_START, //1
  94. UNIT_FIELD_MOUNTDISPLAYID = 0x081 + UNIT_START, //1
  95. UNIT_FIELD_MINDAMAGE = 0x082 + UNIT_START, //1
  96. UNIT_FIELD_MAXDAMAGE = 0x083 + UNIT_START, //1
  97. UNIT_FIELD_BYTES_1 = 0x084 + UNIT_START, //1
  98. UNIT_FIELD_PETNUMBER = 0x085 + UNIT_START, //1
  99. UNIT_FIELD_PET_NAME_TIMESTAMP = 0x086 + UNIT_START, //1
  100. UNIT_FIELD_PETEXPERIENCE = 0x087 + UNIT_START, //1
  101. UNIT_FIELD_PETNEXTLEVELEXP = 0x088 + UNIT_START, //1
  102. UNIT_DYNAMIC_FLAGS = 0x089 + UNIT_START, //1
  103. UNIT_CHANNEL_SPELL = 0x08A + UNIT_START, //1
  104. UNIT_MOD_CAST_SPEED = 0x08B + UNIT_START, //1
  105. UNIT_CREATED_BY_SPELL = 0x08C + UNIT_START, //1
  106. UNIT_NPC_FLAGS   = 0x08D + UNIT_START, //1
  107. UNIT_NPC_EMOTESTATE = 0x08E + UNIT_START, //1
  108. UNIT_TRAINING_POINTS = 0x08F + UNIT_START, //1
  109. UNIT_FIELD_STAT0 = 0x090 + UNIT_START, //1
  110. UNIT_FIELD_STAT1 = 0x091 + UNIT_START, //1
  111. UNIT_FIELD_STAT2 = 0x092 + UNIT_START, //1
  112. UNIT_FIELD_STAT3 = 0x093 + UNIT_START, //1
  113. UNIT_FIELD_STAT4 = 0x094 + UNIT_START, //1
  114. UNIT_FIELD_RESISTANCES = 0x095 + UNIT_START, //7
  115. UNIT_FIELD_ATTACKPOWER = 0x09C + UNIT_START, //1
  116. UNIT_FIELD_BASE_MANA = 0x09D + UNIT_START, //1
  117. UNIT_ATTACK_POWER_MODS = 0x09E + UNIT_START, //1
  118. UNIT_FIELD_PADDING = 0x09F + UNIT_START, //1
  119. UNIT_END = 0x0A0 + UNIT_START,
  120. };
  121. enum PlayerUpdateFields {
  122. PLAYER_START = UNIT_END,
  123. PLAYER_SELECTION = 0x000 + PLAYER_START, //size 2        
  124. PLAYER_DUEL_ARBITER = 0x002 + PLAYER_START, //size 2       
  125. PLAYER_GUILDID = 0x004 + PLAYER_START, //size 1        
  126. PLAYER_GUILDRANK = 0x005 + PLAYER_START, //size 1        
  127. PLAYER_BYTES = 0x006 + PLAYER_START, //size 1        
  128. PLAYER_BYTES_2 = 0x007 + PLAYER_START, //size 1        
  129. PLAYER_BYTES_3 = 0x008 + PLAYER_START, //1        
  130. PLAYER_DUEL_TEAM = 0x009 + PLAYER_START, //1        
  131. PLAYER_GUILD_TIMESTAMP = 0x00A + PLAYER_START, //1        
  132. PLAYER_FIELD_PAD_0 = 0x00B + PLAYER_START, //1        
  133. PLAYER_FIELD_INV_SLOT_HEAD = 0x00C + PLAYER_START, //2Eh        
  134. PLAYER_FIELD_PACK_SLOT_1 = 0x03A + PLAYER_START, //20h        
  135. PLAYER_FIELD_BANK_SLOT_1 = 0x05A + PLAYER_START, //30h       
  136. PLAYER_FIELD_BANKBAG_SLOT_1 = 0x08A + PLAYER_START, //0Ch        
  137. PLAYER_FIELD_VENDORBUYBACK_SLOT = 0x096 + PLAYER_START, //2
  138. PLAYER_FARSIGHT = 0x098 + PLAYER_START, //2
  139. PLAYER__FIELD_COMBO_TARGET = 0x09A + PLAYER_START, //2
  140. PLAYER_FIELD_BUYBACK_NPC = 0x09C + PLAYER_START, //2
  141. PLAYER_XP = 0x09E + PLAYER_START, //1
  142. PLAYER_NEXT_LEVEL_XP = 0x09F + PLAYER_START, //1
  143. PLAYER_SKILL_INFO_1_1 = 0x00A0 + PLAYER_START, //180
  144. PLAYER_QUEST_LOG_1_1 = 0x0220 + PLAYER_START, //3C
  145. PLAYER_CHARACTER_POINTS1 = 0x025C + PLAYER_START, //1
  146. PLAYER_CHARACTER_POINTS2 = 0x025D + PLAYER_START, //1
  147. PLAYER_TRACK_CREATURES = 0x025E + PLAYER_START, //1
  148. PLAYER_TRACK_RESOURCES = 0x025F + PLAYER_START, //1
  149. PLAYER_CHAT_FILTERS = 0x0260 + PLAYER_START, //1
  150. PLAYER_BLOCK_PERCENTAGE = 0x0261 + PLAYER_START, //1
  151. PLAYER_DODGE_PERCENTAGE = 0x0262 + PLAYER_START, //1
  152. PLAYER_PARRY_PERCENTAGE = 0x0263 + PLAYER_START, //1
  153. PLAYER_CRIT_PERCENTAGE = 0x0264 + PLAYER_START, //1
  154. PLAYER_EXPLORED_ZONES_1 = 0x0265 + PLAYER_START, //20
  155. PLAYER_REST_STATE_EXPERIENCE = 0x0285 + PLAYER_START, //1
  156. PLAYER_FIELD_COINAGE = 0x0286 + PLAYER_START, //1
  157. PLAYER_FIELD_POSSTAT0 = 0x0287 + PLAYER_START, //1
  158. PLAYER_FIELD_POSSTAT1 = 0x0288 + PLAYER_START, //1
  159. PLAYER_FIELD_POSSTAT2 = 0x0289 + PLAYER_START, //1
  160. PLAYER_FIELD_POSSTAT3 = 0x028A + PLAYER_START, //1
  161. PLAYER_FIELD_POSSTAT4 = 0x028B + PLAYER_START, //1
  162. PLAYER_FIELD_NEGSTAT0 = 0x028C + PLAYER_START, //1
  163. PLAYER_FIELD_NEGSTAT1 = 0x028D + PLAYER_START, //1
  164. PLAYER_FIELD_NEGSTAT2 = 0x028E + PLAYER_START, //1
  165. PLAYER_FIELD_NEGSTAT3 = 0x028F + PLAYER_START, //1
  166. PLAYER_FIELD_NEGSTAT4 = 0x0290 + PLAYER_START, //1
  167. PLAYER_FIELD_RESISTANCEBUFFMODSPOSITIVE = 0x0291 + PLAYER_START, //7
  168. PLAYER_FIELD_RESISTANCEBUFFMODSNEGATIVE = 0x0298 + PLAYER_START, //7
  169. PLAYER_FIELD_MOD_DAMAGE_DONE_POS = 0x029F + PLAYER_START, //7
  170. PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = 0x02A6 + PLAYER_START, //7
  171. PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = 0x02AD + PLAYER_START, //7
  172. PLAYER_FIELD_BYTES = 0x02B4 + PLAYER_START, //1
  173. PLAYER_AMMO_ID = 0x02B5 + PLAYER_START, //1
  174. PLAYER_FIELD_PVP_MEDALS = 0x02B6 + PLAYER_START, //1
  175. PLAYER_FIELD_BUYBACK_ITEM_ID = 0x02B7 + PLAYER_START, //1
  176. PLAYER_FIELD_BUYBACK_RANDOM_PROPERTIES_ID = 0x02B8 + PLAYER_START, //1
  177. PLAYER_FIELD_BUYBACK_SEED = 0x02B9 + PLAYER_START, //1
  178. PLAYER_FIELD_BUYBACK_PRICE = 0x02BA + PLAYER_START, //1
  179. PLAYER_FIELD_PADDING = 0x02BB + PLAYER_START, //1
  180. PLAYER_END = 0x02BC + PLAYER_START,
  181. };
  182. enum GameObjectUpdateFields {
  183.     GAMEOBJECT_START = OBJECT_END,
  184.     GAMEOBJECT_DISPLAYID = 0x00 + GAMEOBJECT_START, //1
  185.     GAMEOBJECT_FLAGS = 0x01 + GAMEOBJECT_START, //1
  186.     GAMEOBJECT_ROTATION = 0x02 + GAMEOBJECT_START, //4
  187.     GAMEOBJECT_STATE = 0x06 + GAMEOBJECT_START, //1
  188.     GAMEOBJECT_TIMESTAMP = 0x07 + GAMEOBJECT_START, //1
  189.     GAMEOBJECT_POS_X = 0x08 + GAMEOBJECT_START, //1
  190.     GAMEOBJECT_POS_Y = 0x09 + GAMEOBJECT_START, //1
  191.     GAMEOBJECT_POS_Z = 0x00A + GAMEOBJECT_START, //1
  192.     GAMEOBJECT_FACING = 0x00B + GAMEOBJECT_START, //1
  193.     GAMEOBJECT_DYN_FLAGS = 0x00C + GAMEOBJECT_START, //1
  194.     GAMEOBJECT_FACTION = 0x00D + GAMEOBJECT_START, //1
  195.     GAMEOBJECT_TYPE_ID = 0x00E + GAMEOBJECT_START, //1
  196.     GAMEOBJECT_LEVEL = 0x00F + GAMEOBJECT_START, //1
  197.     GAMEOBJECT_END = 0x010 + GAMEOBJECT_START,
  198. };
  199. enum DynamicObjectUpdateFields {
  200.     DYNAMICOBJECT_START = GAMEOBJECT_END,
  201.     DYNAMICOBJECT_CASTER = 0x00 + DYNAMICOBJECT_START,
  202.     DYNAMICOBJECT_BYTES = 0x02 + DYNAMICOBJECT_START,
  203.     DYNAMICOBJECT_SPELLID = 0x03 + DYNAMICOBJECT_START,
  204.     DYNAMICOBJECT_RADIUS = 0x04 + DYNAMICOBJECT_START,
  205.     DYNAMICOBJECT_POS_X = 0x05 + DYNAMICOBJECT_START,
  206.     DYNAMICOBJECT_POS_Y = 0x06 + DYNAMICOBJECT_START,
  207.     DYNAMICOBJECT_POS_Z = 0x07 + DYNAMICOBJECT_START,
  208.     DYNAMICOBJECT_FACING = 0x08 + DYNAMICOBJECT_START,
  209.     DYNAMICOBJECT_PAD = 0x09 + DYNAMICOBJECT_START,
  210.     DYNAMICOBJECT_END = 0x0A + DYNAMICOBJECT_START,
  211. };
  212. enum CorpseUpdateFields {
  213.     CORPSE_START = GAMEOBJECT_END,
  214.     CORPSE_FIELD_OWNER = 0x00 + CORPSE_START,
  215.     CORPSE_FIELD_FACING = 0x02 + CORPSE_START,
  216.     CORPSE_FIELD_POS_X = 0x03 + CORPSE_START,
  217.     CORPSE_FIELD_POS_Y = 0x04 + CORPSE_START,
  218.     CORPSE_FIELD_POS_Z = 0x05 + CORPSE_START,
  219.     CORPSE_FIELD_DISPLAY_ID = 0x06 + CORPSE_START,
  220.     CORPSE_FIELD_ITEM0 = 0x07 + CORPSE_START,
  221.     CORPSE_FIELD_ITEM1 = 0x08 + CORPSE_START,
  222.     CORPSE_FIELD_ITEM2 = 0x09 + CORPSE_START,
  223.     CORPSE_FIELD_ITEM3 = 0x0A + CORPSE_START,
  224.     CORPSE_FIELD_ITEM4 = 0x0B + CORPSE_START,
  225.     CORPSE_FIELD_ITEM5 = 0x0C + CORPSE_START,
  226.     CORPSE_FIELD_BYTES_1 = 0x1A + CORPSE_START,
  227.     CORPSE_FIELD_BYTES_2 = 0x1B + CORPSE_START,
  228.     CORPSE_FIELD_GUILD = 0x1C + CORPSE_START,
  229.     CORPSE_FIELD_FLAGS = 0x1D + CORPSE_START,
  230. };
  231. struct UpdateMask {
  232.     uint8 count;
  233.     uint16 length;
  234.     uint32 * updateMask;
  235.     inline void setBit( const uint32 index ) {
  236.         ( (uint8 *)updateMask )[ index >> 3 ] |= 1 << ( index & 0x7 );
  237.     }
  238. inline void unSetBit( const uint32 index ) {
  239. ( (uint8 *)updateMask )[ index >> 3 ] &= (0xff ^ (1 <<  ( index & 0x7 ) ) );
  240. }
  241.     void setCount(int newcount) { 
  242.         clear( );
  243.         count = newcount;
  244.         length = count*4;
  245.         updateMask = new uint32[count];
  246.         memset(updateMask, 0, length);
  247.     }
  248.     void clear(){
  249.         if (updateMask){
  250.             delete [] updateMask;
  251.             updateMask = 0;
  252.         }
  253.         count = 0;
  254.         length = 0;
  255.     }
  256.     UpdateMask( ) : updateMask( 0 ), count( 0 ), length( 0 ) { }
  257.     ~UpdateMask( ) { clear( ); }
  258. };
  259. #endif
  260. /*
  261. PLAYER_REST_STATE_EXPERIENCE
  262. PLAYER_EXPLORED_ZONES_1
  263. PLAYER_BASE_MANA
  264. PLAYER_PARRY_PERCENTAGE
  265. PLAYER_DODGE_PERCENTAGE
  266. PLAYER_BLOCK_PERCENTAGE
  267. PLAYER_CHAT_FILTERS
  268. PLAYER_TRACK_RESOURCES
  269. PLAYER_TRACK_CREATURES
  270. PLAYER_CHARACTER_POINTS2
  271. PLAYER_CHARACTER_POINTS1
  272. PLAYER_QUEST_LOG_1_1
  273. PLAYER_SKILL_INFO_1_1
  274. PLAYER_NEXT_LEVEL_XP
  275. PLAYER_XP
  276. PLAYER_FIELD_COMBO_TARGET
  277. PLAYER_FARSIGHT
  278. PLAYER_FIELD_BANKBAG_SLOT_1
  279. PLAYER_FIELD_BANK_SLOT_1
  280. PLAYER_FIELD_PACK_SLOT_1
  281. PLAYER_FIELD_INV_SLOT_HEAD
  282. PLAYER_FIELD_PAD_0
  283. PLAYER_GUILD_TIMESTAMP
  284. PLAYER_DUEL_TEAM
  285. PLAYER_BYTES_3
  286. PLAYER_BYTES_2
  287. PLAYER_BYTES
  288. PLAYER_GUILDRANK
  289. PLAYER_GUILDID
  290. PLAYER_DUEL_ARBITER
  291. PLAYER_SELECTION
  292.     UNIT_FIELD_CHARM
  293.     UNIT_FIELD_SUMMON
  294.     UNIT_FIELD_CHARMEDBY
  295.     UNIT_FIELD_SUMMONEDBY
  296.     UNIT_FIELD_CREATEDBY
  297.     UNIT_FIELD_TARGET
  298.     UNIT_FIELD_CHANNEL_OBJECT
  299.     UNIT_FIELD_HEALTH
  300.     UNIT_FIELD_POWER1
  301.     UNIT_FIELD_POWER2
  302.     UNIT_FIELD_POWER3
  303.     UNIT_FIELD_POWER4
  304.     UNIT_FIELD_POWER5
  305.     UNIT_FIELD_MAXHEALTH
  306.     UNIT_FIELD_MAXPOWER1
  307.     UNIT_FIELD_MAXPOWER2
  308.     UNIT_FIELD_MAXPOWER3
  309.     UNIT_FIELD_MAXPOWER4
  310.     UNIT_FIELD_MAXPOWER5
  311.     UNIT_FIELD_LEVEL
  312.     UNIT_FIELD_FACTIONTEMPLATE
  313.     UNIT_FIELD_BYTES_0
  314.     UNIT_VIRTUAL_ITEM_SLOT_DISPLAY
  315.     UNIT_VIRTUAL_ITEM_INFO
  316.     UNIT_FIELD_FLAGS
  317.     UNIT_FIELD_AURA
  318.     UNIT_FIELD_AURALEVELS
  319.     UNIT_FIELD_AURAAPPLICATIONS
  320.     UNIT_FIELD_AURAFLAGS
  321.     UNIT_FIELD_AURASTATE
  322.     UNIT_FIELD_BASEATTACKTIME
  323.     UNIT_FIELD_BOUNDINGRADIUS
  324.     UNIT_FIELD_COMBATREACH
  325.     UNIT_FIELD_WEAPONREACH
  326.     UNIT_FIELD_DISPLAYID
  327.     UNIT_FIELD_MOUNTDISPLAYID
  328.     UNIT_FIELD_MINDAMAGE
  329.     UNIT_FIELD_MAXDAMAGE
  330.     UNIT_FIELD_BYTES_1
  331.     UNIT_FIELD_PETNUMBER
  332.     UNIT_FIELD_PET_NAME_TIMESTAMP
  333.     UNIT_FIELD_PETEXPERIENCE
  334.     UNIT_FIELD_PETNEXTLEVELEXP
  335.     UNIT_DYNAMIC_FLAGS
  336.     UNIT_CHANNEL_SPELL
  337.     UNIT_MOD_CAST_SPEED
  338.     UNIT_CREATED_BY_SPELL
  339.     UNIT_NPC_FLAGS
  340.     UNIT_NPC_EMOTESTATE
  341.     UNIT_FIELD_PADDING
  342. */