void C_DECL A_BridgeOrbit(mobj_t* actor) { if(!actor) return; if(actor->target->special1) { P_MobjChangeState(actor, S_NULL); } actor->args[0] += 3; P_MobjUnlink(actor); actor->origin[VX] = actor->target->origin[VX]; actor->origin[VY] = actor->target->origin[VY]; actor->origin[VX] += orbitTableX[actor->args[0]]; actor->origin[VY] += orbitTableY[actor->args[0]]; P_MobjLink(actor); }
void SV_LoadGameClient(uint /*sessionId*/) { throw de::Error("SV_LoadGameClient", "Not currently implemented"); #if 0 #if !__JHEXEN__ // unsupported in libhexen player_t *cpl = players + CONSOLEPLAYER; mobj_t *mo = cpl->plr->mo; if(!IS_CLIENT || !mo) return; de::game::GameStateFolder *session = new de::game::GameStateFolder(saveNameForClientSessionId(sessionId)); de::game::GameStateMetadata *metadata = new de::game::GameStateMetadata; //G_ReadLegacySessionMetadata(metadata, reader); metadata->set("sessionId", sessionId); session->replaceMetadata(metadata); de::Path path = de::String("/savegame") / "client" / session->path(); if(!SV_OpenFileForRead(path)) { delete session; App_Log(DE2_RES_WARNING, "SV_LoadGameClient: Failed opening \"%s\" for reading", path.toString().toLatin1().constData()); return; } if((*metadata)["magic"].value().asNumber() != MY_CLIENT_SAVE_MAGIC) { SV_CloseFile(); delete session; App_Log(DE2_RES_ERROR, "Client save file format not recognized"); return; } Reader1 *reader = SV_NewReader(); int const saveVersion = (*metadata)["version"].value().asNumber(); Uri *mapUri = Uri_NewWithPath2((*metadata)["mapUri"].value().asText().toUtf8().constData(), RC_NULL); GameRules *rules = 0; if(metadata->hasSubrecord("gameRules")) { rules = GameRules::fromRecord(metadata->subrecord("gameRules")); } // Do we need to change the map? if(gfw_Session()->mapUri() != *reinterpret_cast<de::Uri *>(mapUri)) { gfw_Session()->begin(*mapUri, 0/*default*/, *rules); } else if(rules) { gfw_Session()->rules() = *rules; } delete rules; rules = 0; Uri_Delete(mapUri); mapUri = 0; mapTime = (*metadata)["mapTime"].value().asNumber(); P_MobjUnlink(mo); mo->origin[VX] = FIX2FLT(Reader_ReadInt32(reader)); mo->origin[VY] = FIX2FLT(Reader_ReadInt32(reader)); mo->origin[VZ] = FIX2FLT(Reader_ReadInt32(reader)); P_MobjLink(mo); mo->floorZ = FIX2FLT(Reader_ReadInt32(reader)); mo->ceilingZ = FIX2FLT(Reader_ReadInt32(reader)); mo->angle = Reader_ReadInt32(reader); /* $unifiedangles */ cpl->plr->lookDir = Reader_ReadFloat(reader); /* $unifiedangles */ #if __JHEXEN__ if(saveVersion >= 4) #else if(saveVersion >= 5) #endif { SV_AssertSegment(ASEG_PLAYER_HEADER); } playerheader_t plrHdr; plrHdr.read(reader, saveVersion); cpl->read(reader, plrHdr); MapStateReader(*session).read(Str_Text(Uri_Resolved(mapUri))); SV_CloseFile(); Reader_Delete(reader); delete session; #else DENG2_UNUSED(sessionId); #endif #endif }