Put Character on CConnectedPlayer finally to use

This commit is contained in:
Sofia 2017-05-09 17:22:52 +03:00
parent 87e3f31f9f
commit 2357aa2da5
2 changed files with 4 additions and 2 deletions

View File

@ -168,7 +168,10 @@ namespace Cyber.Networking.Clientside {
// Change it into a PC instead. // Change it into a PC instead.
EntityType = EntityType.PC; EntityType = EntityType.PC;
} }
Spawner.Spawn(EntityType, SpawnPkt.Position, SpawnPkt.SyncBaseIDList); GameObject Obj = Spawner.Spawn(EntityType, SpawnPkt.Position, SpawnPkt.SyncBaseIDList);
if (SpawnPkt.OwnerID > -1) {
Players[SpawnPkt.OwnerID].Character = Obj.GetComponent<Character>();
}
break; break;
case (PktType.MoveCreature): case (PktType.MoveCreature):
MoveCreaturePkt MoveCreature = new MoveCreaturePkt(); MoveCreaturePkt MoveCreature = new MoveCreaturePkt();

View File

@ -33,7 +33,6 @@ namespace Cyber.Networking.Clientside {
if (LatestSyncID < SyncPacket.SyncPacketID) { if (LatestSyncID < SyncPacket.SyncPacketID) {
LatestSyncID = SyncPacket.SyncPacketID; LatestSyncID = SyncPacket.SyncPacketID;
SyncPacket.ApplySync(message.reader); SyncPacket.ApplySync(message.reader);
Debug.Log("Applied Sync " + LatestSyncID);
} }
// Otherwise disregard the sync. // Otherwise disregard the sync.