Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tell our clients to spawn a mobj
- // Currently only used for the item respawn queue in -altdeath and -newdeath
- void SV_SpawnMobj (mobj_t *mo)
- {
- ENetPacket *pk = enet_packet_create (NULL, 19, ENET_PACKET_FLAG_RELIABLE);
- void *p = pk->data;
- WriteUInt8((uint8_t**)&p, MSG_SMOBJ);
- WriteInt32((int32_t**)&p, mo->x);
- WriteInt32((int32_t**)&p, mo->y);
- WriteInt32((int32_t**)&p, mo->z);
- WriteUInt16((uint16_t**)&p, (uint16_t)mo->type);
- WriteUInt16((uint16_t**)&p, (uint16_t)mo->state);
- WriteUInt16((uint16_t**)&p, mo->netid);
- printf ("%i, %i, %i, %i, %i, %i\n",
- mo->x, mo->y, mo->z, mo->type, mo->state, mo->netid);
- SV_BroadcastPacket(pk, -1);
- return;
- }
- CLIENTSIDE:
- case MSG_SMOBJ:
- {
- mobj_t *mo;
- statenum_t st;
- mo = P_SpawnMobj (
- (fixed_t)ReadInt32((int32_t**)&p),
- (fixed_t)ReadInt32((int32_t**)&p),
- (fixed_t)ReadInt32((int32_t**)&p),
- (mobjtype_t)ReadUInt16((uint16_t**)&p));
- if ((st = ReadUInt16((uint16_t**)&p)) < NUMSTATES)
- P_SetMobjState(mo, (statenum_t)st);
- mo->netid = ReadUInt16((uint16_t**)&p);
- printf ("%i, %i, %i, %i, %i, %i\n",
- mo->x, mo->y, mo->z, mo->type, mo->state, mo->netid);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement