mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-11 14:34:40 +00:00
Cloak Fix (#269)
* player maintains cloaked state during continent transfers; cloak state is properly communicated to any vehicle the player spawns that can cloak * cloaking/mounting excpetion for the Wraith
This commit is contained in:
parent
612bceb440
commit
4c77c2788b
4 changed files with 16 additions and 9 deletions
|
|
@ -341,7 +341,7 @@ class Player(private val core : Avatar) extends PlanetSideGameObject
|
|||
Jumping
|
||||
}
|
||||
|
||||
def Cloaked : Boolean = jumping
|
||||
def Cloaked : Boolean = cloaked
|
||||
|
||||
def Cloaked_=(isCloaked : Boolean) : Boolean = {
|
||||
cloaked = isCloaked
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class VehicleSpawnControlLoadVehicle(pad : VehicleSpawnPad) extends VehicleSpawn
|
|||
//load the vehicle in the spawn pad trench, underground, initially
|
||||
vehicle.Position = vehicle.Position - Vector3(0, 0, if(GlobalDefinitions.isFlightVehicle(vehicle.Definition)) 9 else 5)
|
||||
}
|
||||
vehicle.Cloaked = vehicle.Definition.CanCloak && entry.driver.Cloaked
|
||||
Continent.VehicleEvents ! VehicleSpawnPad.LoadVehicle(vehicle, Continent)
|
||||
context.system.scheduler.scheduleOnce(100 milliseconds, railJack, VehicleSpawnControl.Process.RailJackAction(entry))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import scodec.codecs._
|
|||
* values in between are possible;
|
||||
* vehicles that hover also influence this field as expected
|
||||
* @param unk5 na - Possibly a flag to indicate the vehicle is attached to something else e.g. is in a galaxy/lodestar cargo bay
|
||||
* @param unk6 na
|
||||
* @param is_cloaked vehicle is cloaked
|
||||
* @see `PlacementData`
|
||||
*/
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ final case class VehicleStateMessage(vehicle_guid : PlanetSideGUID,
|
|||
unk4 : Int,
|
||||
wheel_direction : Int,
|
||||
unk5 : Boolean,
|
||||
unk6 : Boolean
|
||||
is_cloaked : Boolean
|
||||
) extends PlanetSideGamePacket {
|
||||
type Packet = VehicleStateMessage
|
||||
def opcode = GamePacketOpcode.VehicleStateMessage
|
||||
|
|
@ -85,6 +85,6 @@ object VehicleStateMessage extends Marshallable[VehicleStateMessage] {
|
|||
("unk4" | uint4L) ::
|
||||
("wheel_direction" | uintL(5)) ::
|
||||
("int5" | bool) ::
|
||||
("int6" | bool)
|
||||
("is_cloaked" | bool)
|
||||
).as[VehicleStateMessage]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1397,6 +1397,11 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
case None => ;
|
||||
}
|
||||
OwnVehicle(obj, tplayer)
|
||||
if(obj.Definition == GlobalDefinitions.quadstealth) {
|
||||
//wraith cloak state matches the cloak state of the driver
|
||||
//phantasm doesn't uncloak if the driver is uncloaked and no other vehicle cloaks
|
||||
obj.Cloaked = tplayer.Cloaked
|
||||
}
|
||||
}
|
||||
AccessContents(obj)
|
||||
UpdateWeaponAtSeatPosition(obj, seat_num)
|
||||
|
|
@ -1997,9 +2002,8 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
}
|
||||
|
||||
case VehicleResponse.ConcealPlayer(player_guid) =>
|
||||
//TODO this is the correct message; but, I don't know how to undo the effects of it
|
||||
//sendResponse(GenericObjectActionMessage(player_guid, 36))
|
||||
sendResponse(PlanetsideAttributeMessage(player_guid, 29, 1))
|
||||
sendResponse(GenericObjectActionMessage(player_guid, 36))
|
||||
//sendResponse(PlanetsideAttributeMessage(player_guid, 29, 1))
|
||||
|
||||
case VehicleResponse.DismountVehicle(bailType, wasKickedByDriver) =>
|
||||
if(tplayer_guid != guid) {
|
||||
|
|
@ -3267,6 +3271,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
player.FacingYawUpper = yaw_upper
|
||||
player.Crouching = is_crouching
|
||||
player.Jumping = is_jumping
|
||||
player.Cloaked = player.ExoSuit == ExoSuitType.Infiltration && is_cloaking
|
||||
|
||||
if(vel.isDefined && usingMedicalTerminal.isDefined) {
|
||||
continent.GUID(usingMedicalTerminal) match {
|
||||
|
|
@ -3323,7 +3328,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
//log.warn(s"ChildObjectState: player $player not related to anything with a controllable agent")
|
||||
}
|
||||
|
||||
case msg @ VehicleStateMessage(vehicle_guid, unk1, pos, ang, vel, flight, unk6, unk7, wheels, unk9, unkA) =>
|
||||
case msg @ VehicleStateMessage(vehicle_guid, unk1, pos, ang, vel, flight, unk6, unk7, wheels, unk9, is_cloaked) =>
|
||||
if(deadState == DeadState.Alive) {
|
||||
GetVehicleAndSeat() match {
|
||||
case (Some(obj), Some(0)) =>
|
||||
|
|
@ -3340,7 +3345,8 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
if(obj.Definition.CanFly) {
|
||||
obj.Flying = flight.nonEmpty //usually Some(7)
|
||||
}
|
||||
vehicleService ! VehicleServiceMessage(continent.Id, VehicleAction.VehicleState(player.GUID, vehicle_guid, unk1, pos, ang, vel, flight, unk6, unk7, wheels, unk9, unkA))
|
||||
obj.Cloaked = obj.Definition.CanCloak && is_cloaked
|
||||
vehicleService ! VehicleServiceMessage(continent.Id, VehicleAction.VehicleState(player.GUID, vehicle_guid, unk1, pos, ang, vel, flight, unk6, unk7, wheels, unk9, is_cloaked))
|
||||
}
|
||||
case (None, _) =>
|
||||
//log.error(s"VehicleState: no vehicle $vehicle_guid found in zone")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue