Don't use RaceDescPtr as both a pointer and an integer containing
two values. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2300 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -34,11 +34,12 @@
|
|||||||
#define NUM_CAPTAINS_NAMES 16
|
#define NUM_CAPTAINS_NAMES 16
|
||||||
|
|
||||||
#define OwnStarShip(S,p,n) \
|
#define OwnStarShip(S,p,n) \
|
||||||
(S)->RaceDescPtr = (RACE_DESCPTR)MAKE_DWORD(p, n)
|
(S)->s.Player = (p); \
|
||||||
|
(S)->s.Captain = (n);
|
||||||
#define StarShipCaptain(S) \
|
#define StarShipCaptain(S) \
|
||||||
(BYTE)HIWORD ((S)->RaceDescPtr)
|
(S)->s.Captain
|
||||||
#define StarShipPlayer(S) \
|
#define StarShipPlayer(S) \
|
||||||
(COUNT)LOWORD ((S)->RaceDescPtr)
|
(S)->s.Player
|
||||||
#define PickCaptainName() (((COUNT)TFB_Random () \
|
#define PickCaptainName() (((COUNT)TFB_Random () \
|
||||||
& (NUM_CAPTAINS_NAMES - 1)) \
|
& (NUM_CAPTAINS_NAMES - 1)) \
|
||||||
+ NAME_OFFSET)
|
+ NAME_OFFSET)
|
||||||
|
|||||||
+30
-8
@@ -254,7 +254,21 @@ typedef struct
|
|||||||
HSTARSHIP succ;
|
HSTARSHIP succ;
|
||||||
|
|
||||||
DWORD RaceResIndex;
|
DWORD RaceResIndex;
|
||||||
RACE_DESCPTR RaceDescPtr;
|
|
||||||
|
/* This field is abused to store other data when the ship
|
||||||
|
* is in GLOBAL(built_ship_q), GLOBDATA(npc_built_ship_q),
|
||||||
|
* or race_q[], namely the side this ship is on (accessed
|
||||||
|
* through StarShipPlayer()), and the captains name for
|
||||||
|
* the ship (accessed through StarShipCaptain()).
|
||||||
|
* These values are set using OwnStarShip(). */
|
||||||
|
union {
|
||||||
|
RACE_DESCPTR RaceDescPtr;
|
||||||
|
struct {
|
||||||
|
COUNT Player;
|
||||||
|
BYTE Captain;
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
BYTE captains_name_index;
|
BYTE captains_name_index;
|
||||||
|
|
||||||
BYTE weapon_counter;
|
BYTE weapon_counter;
|
||||||
@@ -278,13 +292,21 @@ typedef struct
|
|||||||
HSTARSHIP succ;
|
HSTARSHIP succ;
|
||||||
|
|
||||||
DWORD RaceResIndex;
|
DWORD RaceResIndex;
|
||||||
RACE_DESCPTR RaceDescPtr;
|
|
||||||
/* This field is abused to store other data when the ship
|
/* This field is abused to store other data when the ship
|
||||||
* is in GLOBAL(built_ship_q), GLOBDATA(npc_built_ship_q),
|
* is in GLOBAL(built_ship_q), GLOBDATA(npc_built_ship_q),
|
||||||
* or race_q[], namely the side this ship is on (accessed
|
* or race_q[], namely the side this ship is on (accessed
|
||||||
* through StarShipPlayer()), and the captains name for
|
* through StarShipPlayer()), and the captains name for
|
||||||
* the ship (accessed through StarShipCaptain()).
|
* the ship (accessed through StarShipCaptain()).
|
||||||
* These values are set using OwnStarShip(). */
|
* These values are set using OwnStarShip(). */
|
||||||
|
union {
|
||||||
|
RACE_DESCPTR RaceDescPtr;
|
||||||
|
struct {
|
||||||
|
COUNT Player;
|
||||||
|
BYTE Captain;
|
||||||
|
} s;
|
||||||
|
};
|
||||||
|
|
||||||
SHIP_INFO ShipInfo;
|
SHIP_INFO ShipInfo;
|
||||||
} SHIP_FRAGMENT;
|
} SHIP_FRAGMENT;
|
||||||
typedef SHIP_FRAGMENT *PSHIP_FRAGMENT;
|
typedef SHIP_FRAGMENT *PSHIP_FRAGMENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user