void P_DSparilTeleport (AActor *actor) { fixed_t prevX; fixed_t prevY; fixed_t prevZ; AActor *mo; AActor *spot; DSpotState *state = DSpotState::GetSpotState(); if (state == NULL) return; spot = state->GetSpotWithMinMaxDistance(PClass::FindClass("BossSpot"), actor->X(), actor->Y(), 128*FRACUNIT, 0); if (spot == NULL) return; prevX = actor->X(); prevY = actor->Y(); prevZ = actor->Z(); if (P_TeleportMove (actor, spot->Pos(), false)) { mo = Spawn("Sorcerer2Telefade", prevX, prevY, prevZ, ALLOW_REPLACE); if (mo) mo->Translation = actor->Translation; S_Sound (mo, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->SetState (actor->FindState("Teleport")); S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->SetZ(actor->floorz, false); actor->angle = spot->angle; actor->velx = actor->vely = actor->velz = 0; } }
void P_DSparilTeleport (AActor *actor) { DVector3 prev; AActor *mo; AActor *spot; DSpotState *state = DSpotState::GetSpotState(); if (state == NULL) return; spot = state->GetSpotWithMinMaxDistance(PClass::FindClass("BossSpot"), actor->X(), actor->Y(), 128, 0); if (spot == NULL) return; prev = actor->Pos(); if (P_TeleportMove (actor, spot->Pos(), false)) { mo = Spawn("Sorcerer2Telefade", prev, ALLOW_REPLACE); if (mo) mo->Translation = actor->Translation; S_Sound (mo, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->SetState (actor->FindState("Teleport")); S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->SetZ(actor->floorz); actor->Angles.Yaw = spot->Angles.Yaw; actor->Vel.Zero(); } }