newnet: Rename multibot.c -> multibot.cpp.

master
Cyp 2010-07-02 09:30:59 +02:00
parent 0b0e986ec6
commit 3505c31c0e
4 changed files with 8 additions and 20 deletions

View File

@ -99,19 +99,17 @@ PACKETDIR NETgetPacketDir(void);
}
template <typename EnumT>
static BOOL NETenum(EnumT* enumPtr)
static void NETenum(EnumT* enumPtr)
{
int32_t val;
if (NETgetPacketDir() == PACKET_ENCODE)
val = *enumPtr;
const BOOL retVal = NETint32_t(&val);
NETint32_t(&val);
if (NETgetPacketDir() == PACKET_DECODE)
*enumPtr = static_cast<EnumT>(val);
return retVal;
}
extern "C"

View File

@ -241,7 +241,7 @@ warzone2100_SOURCES = \
miscimd.c \
mission.c \
move.c \
multibot.c \
multibot.cpp \
multigifts.c \
multiint.c \
multijoin.c \

View File

@ -78,7 +78,7 @@ SRC= \
miscimd.c \
mission.c \
move.c \
multibot.c \
multibot.cpp \
multigifts.c \
multiint.c \
multijoin.c \

View File

@ -434,16 +434,6 @@ BOOL recvDroid(NETQUEUE queue)
}
/*!
* Type of the target of the movement
*/
typedef enum {
NET_ORDER_SUBTYPE_POSITION,
NET_ORDER_SUBTYPE_OBJECT,
NET_ORDER_SUBTYPE_SPECIAL // x and y are 0, no idea what that means
} NET_ORDER_SUBTYPE;
// ////////////////////////////////////////////////////////////////////////////
/*!
* Droid Group/selection orders.
@ -456,7 +446,7 @@ BOOL SendGroupOrderSelected(uint8_t player, uint32_t x, uint32_t y, const BASE_O
NETbeginEncode(NETgameQueue(selectedPlayer), GAME_GROUPORDER);
{
DROID_ORDER order = (altOrder?DORDER_UNKNOWN_ALT:DORDER_UNKNOWN);
DROID_ORDER order = (DROID_ORDER)(altOrder?DORDER_UNKNOWN_ALT:DORDER_UNKNOWN);
BOOL subType = (psObj) ? true : false, cmdOrder = false;
DROID* psDroid;
uint8_t droidCount;
@ -614,7 +604,7 @@ BOOL recvGroupOrder(NETQUEUE queue)
NETuint8_t(&droidCount);
// Allocate some space on the stack to hold the droid IDs
droidIDs = alloca(droidCount * sizeof(uint32_t));
droidIDs = (uint32_t *)alloca(droidCount * sizeof(uint32_t));
// Retrieve the droids from the message
for (i = 0; i < droidCount; ++i)
@ -676,7 +666,7 @@ BOOL recvGroupOrder(NETQUEUE queue)
/* Otherwise if the droids are being ordered to `goto' a
* specific position. Then we don't have any destination info
*/
ProcessDroidOrder(psDroid, order, x, y, 0, 0);
ProcessDroidOrder(psDroid, order, x, y, (OBJECT_TYPE)0, 0);
}
syncDebugDroid(psDroid, '>');
@ -833,7 +823,7 @@ BOOL recvDroidInfo(NETQUEUE queue)
// Otherwise it is just a normal "goto location" order
else
{
ProcessDroidOrder(psDroid, order, x, y, destType, destId);
ProcessDroidOrder(psDroid, order, x, y, (OBJECT_TYPE)destType, destId);
}
}
NETend();