mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-29 08:15:29 +00:00
Merge pull request #684 from Mazo/rexo-battlebus-driver
Allow rexo to mount battlebusses as the driver (fixes #519)
This commit is contained in:
commit
29b56eb8a4
3 changed files with 19 additions and 9 deletions
|
|
@ -6042,7 +6042,6 @@ object GlobalDefinitions {
|
||||||
apc_tr.RepairIfDestroyed = false
|
apc_tr.RepairIfDestroyed = false
|
||||||
apc_tr.MaxShields = 1200
|
apc_tr.MaxShields = 1200
|
||||||
apc_tr.Seats += 0 -> new SeatDefinition()
|
apc_tr.Seats += 0 -> new SeatDefinition()
|
||||||
apc_tr.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
|
|
||||||
apc_tr.Seats += 1 -> new SeatDefinition()
|
apc_tr.Seats += 1 -> new SeatDefinition()
|
||||||
apc_tr.Seats(1).ControlledWeapon = 11
|
apc_tr.Seats(1).ControlledWeapon = 11
|
||||||
apc_tr.Seats += 2 -> new SeatDefinition()
|
apc_tr.Seats += 2 -> new SeatDefinition()
|
||||||
|
|
@ -6106,7 +6105,6 @@ object GlobalDefinitions {
|
||||||
apc_nc.RepairIfDestroyed = false
|
apc_nc.RepairIfDestroyed = false
|
||||||
apc_nc.MaxShields = 1200
|
apc_nc.MaxShields = 1200
|
||||||
apc_nc.Seats += 0 -> new SeatDefinition()
|
apc_nc.Seats += 0 -> new SeatDefinition()
|
||||||
apc_nc.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
|
|
||||||
apc_nc.Seats += 1 -> new SeatDefinition()
|
apc_nc.Seats += 1 -> new SeatDefinition()
|
||||||
apc_nc.Seats(1).ControlledWeapon = 11
|
apc_nc.Seats(1).ControlledWeapon = 11
|
||||||
apc_nc.Seats += 2 -> new SeatDefinition()
|
apc_nc.Seats += 2 -> new SeatDefinition()
|
||||||
|
|
@ -6170,7 +6168,6 @@ object GlobalDefinitions {
|
||||||
apc_vs.RepairIfDestroyed = false
|
apc_vs.RepairIfDestroyed = false
|
||||||
apc_vs.MaxShields = 1200
|
apc_vs.MaxShields = 1200
|
||||||
apc_vs.Seats += 0 -> new SeatDefinition()
|
apc_vs.Seats += 0 -> new SeatDefinition()
|
||||||
apc_vs.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
|
|
||||||
apc_vs.Seats += 1 -> new SeatDefinition()
|
apc_vs.Seats += 1 -> new SeatDefinition()
|
||||||
apc_vs.Seats(1).ControlledWeapon = 11
|
apc_vs.Seats(1).ControlledWeapon = 11
|
||||||
apc_vs.Seats += 2 -> new SeatDefinition()
|
apc_vs.Seats += 2 -> new SeatDefinition()
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,9 @@ class VehicleControl(vehicle: Vehicle)
|
||||||
PrepareForDeletion()
|
PrepareForDeletion()
|
||||||
context.become(ReadyToDelete)
|
context.become(ReadyToDelete)
|
||||||
|
|
||||||
|
case VehicleControl.AssignOwnership(player) =>
|
||||||
|
vehicle.AssignOwnership(player)
|
||||||
|
|
||||||
case _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -860,6 +863,8 @@ object VehicleControl {
|
||||||
|
|
||||||
private case class Deletion()
|
private case class Deletion()
|
||||||
|
|
||||||
|
final case class AssignOwnership(player: Option[Player])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a given activity entry would invalidate the act of charging vehicle shields this tick.
|
* Determine if a given activity entry would invalidate the act of charging vehicle shields this tick.
|
||||||
* @param now the current time (in nanoseconds)
|
* @param now the current time (in nanoseconds)
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,11 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
|
||||||
vehicle.GUID = PlanetSideGUID(10)
|
vehicle.GUID = PlanetSideGUID(10)
|
||||||
vehicle.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle), "vehicle-test")
|
vehicle.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle), "vehicle-test")
|
||||||
|
|
||||||
|
val vehicle2 = Vehicle(GlobalDefinitions.lightning)
|
||||||
|
vehicle2.Faction = PlanetSideEmpire.TR
|
||||||
|
vehicle2.GUID = PlanetSideGUID(11)
|
||||||
|
vehicle2.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle2), "vehicle2-test")
|
||||||
|
|
||||||
val player1 = Player(VehicleTest.avatar1)
|
val player1 = Player(VehicleTest.avatar1)
|
||||||
player1.ExoSuit = ExoSuitType.Reinforced
|
player1.ExoSuit = ExoSuitType.Reinforced
|
||||||
player1.GUID = PlanetSideGUID(1)
|
player1.GUID = PlanetSideGUID(1)
|
||||||
|
|
@ -359,9 +364,9 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
|
||||||
player3.GUID = PlanetSideGUID(3)
|
player3.GUID = PlanetSideGUID(3)
|
||||||
|
|
||||||
"Vehicle Control" should {
|
"Vehicle Control" should {
|
||||||
"block players from sitting if their exo-suit is not allowed by the seat" in {
|
"block players from sitting if their exo-suit is not allowed by the seat - apc_tr" in {
|
||||||
//disallow
|
// disallow
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) //Reinforced in non-MAX seat
|
vehicle2.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) // Reinforced in non-reinforced seat
|
||||||
checkCanNotMount()
|
checkCanNotMount()
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player2, 0), probe.ref) //MAX in non-Reinforced seat
|
vehicle.Actor.tell(Mountable.TryMount(player2, 0), probe.ref) //MAX in non-Reinforced seat
|
||||||
checkCanNotMount()
|
checkCanNotMount()
|
||||||
|
|
@ -373,11 +378,14 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
|
||||||
checkCanNotMount()
|
checkCanNotMount()
|
||||||
|
|
||||||
//allow
|
//allow
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref)
|
vehicle.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) // Reinforced in driver seat allowing all except MAX
|
||||||
checkCanMount()
|
checkCanMount()
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player2, 9), probe.ref)
|
vehicle.Actor.tell(VehicleControl.AssignOwnership(None), probe.ref) // Reset ownership to allow further driver seat mounting tests
|
||||||
|
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref) // Reinforced in passenger seat allowing all except MAX
|
||||||
checkCanMount()
|
checkCanMount()
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player3, 0), probe.ref)
|
vehicle.Actor.tell(Mountable.TryMount(player2, 9), probe.ref) // MAX in MAX-only seat
|
||||||
|
checkCanMount()
|
||||||
|
vehicle.Actor.tell(Mountable.TryMount(player3, 0), probe.ref) // Agile in driver seat allowing all except MAX
|
||||||
checkCanMount()
|
checkCanMount()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue