mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 21:51:19 -04:00
Checkpoint blocks should also save orientation. (Thanks goodlyay)
This commit is contained in:
parent
84080b1fde
commit
fee26365e3
@ -83,6 +83,8 @@ namespace MCGalaxy.BlockBehaviour {
|
||||
internal static bool Checkpoint(Player p, byte block, ushort x, ushort y, ushort z) {
|
||||
p.useCheckpointSpawn = true;
|
||||
p.checkpointX = x; p.checkpointY = y; p.checkpointZ = z;
|
||||
p.checkpointRotX = p.rot[0]; p.checkpointRotY = p.rot[1];
|
||||
|
||||
int index = p.level.PosToInt(x, y, z);
|
||||
if (index != p.lastCheckpointIndex) {
|
||||
int sendY = (p.pos[1] / 32) * 32 + 10;
|
||||
|
@ -34,6 +34,9 @@ namespace MCGalaxy.Commands {
|
||||
ushort x = (ushort)(16 + (cpSpawn ? p.checkpointX : p.level.spawnx) * 32);
|
||||
ushort y = (ushort)(32 + (cpSpawn ? p.checkpointY : p.level.spawny) * 32);
|
||||
ushort z = (ushort)(16 + (cpSpawn ? p.checkpointZ : p.level.spawnz) * 32);
|
||||
byte rotX = cpSpawn ? p.checkpointRotX : p.level.rotx;
|
||||
byte rotY = cpSpawn ? p.checkpointRotY : p.level.roty;
|
||||
|
||||
if (!p.Game.Referee && !p.Game.Infected && Server.zombie.RoundInProgress)
|
||||
Server.zombie.InfectPlayer(p);
|
||||
|
||||
@ -51,7 +54,7 @@ namespace MCGalaxy.Commands {
|
||||
return;
|
||||
}
|
||||
}
|
||||
p.SendPos(0xFF, x, y, z, p.level.rotx, p.level.roty);
|
||||
p.SendPos(0xFF, x, y, z, rotX, rotY);
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -172,6 +172,7 @@ namespace MCGalaxy {
|
||||
public bool useCheckpointSpawn = false;
|
||||
public int lastCheckpointIndex = -1;
|
||||
public ushort checkpointX, checkpointY, checkpointZ;
|
||||
public byte checkpointRotX, checkpointRotY;
|
||||
public bool voted = false;
|
||||
public bool flipHead = false;
|
||||
public GameProps Game = new GameProps();
|
||||
|
Loading…
x
Reference in New Issue
Block a user