Skip to content

Commit

Permalink
Multiplayer: Handling of GPT_LOCAL_MOBJ_STATE
Browse files Browse the repository at this point in the history
The local mobj state packet is broadcasted to all clients, and
it will enable temporarily local action functions for a mobj
so that it can carry out a local state sequence.
  • Loading branch information
skyjake committed Jan 16, 2012
1 parent c0ad294 commit 391be74
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doomsday/plugins/common/src/d_net.c
Expand Up @@ -475,6 +475,10 @@ void D_HandlePacket(int fromplayer, int type, void *data, size_t length)
NetCl_MobjImpulse(reader);
break;

case GPT_LOCAL_MOBJ_STATE:
NetCl_LocalMobjState(reader);
break;

case GPT_MESSAGE:
#if __JHEXEN__ || __JSTRIFE__
case GPT_YELLOW_MESSAGE:
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/d_netsv.c
Expand Up @@ -1721,7 +1721,7 @@ void NetSv_SendLocalMobjState(mobj_t* mobj, const char* stateName)
Writer_WriteInt32(msg, 0);
#endif

Net_SendPacket(0, GPT_LOCAL_MOBJ_STATE, Writer_Data(msg), Writer_Size(msg));
Net_SendPacket(DDSP_ALL_PLAYERS, GPT_LOCAL_MOBJ_STATE, Writer_Data(msg), Writer_Size(msg));
}

void P_Telefrag(mobj_t *thing)
Expand Down
5 changes: 5 additions & 0 deletions doomsday/plugins/common/src/mobj.c
Expand Up @@ -249,6 +249,11 @@ boolean Mobj_LookForPlayers(mobj_t* mo, boolean allAround)

boolean Mobj_ActionFunctionAllowed(mobj_t* mo)
{
if(IS_CLIENT)
{
if(ClMobj_LocalActionsEnabled(mo))
return true;
}
if(!(mo->ddFlags & DDMF_REMOTE) || // only for local mobjs
(mo->flags3 & MF3_CLIENTACTION)) // action functions allowed?
{
Expand Down

0 comments on commit 391be74

Please sign in to comment.