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:
Fate-JH 2019-10-06 14:03:31 -04:00 committed by GitHub
parent 612bceb440
commit 4c77c2788b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 9 deletions

View file

@ -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

View file

@ -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))
}

View file

@ -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]
}