From 134994447f145908d39a89f2595b38e22532851b Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Wed, 12 Feb 2014 12:11:23 +0100 Subject: [PATCH] Fixed compilation error --- Code/Game/GameProtocols/ObjectProtocols.h | 7 ++++--- .../Game/GameServer/Implementation/GameSession_General.cpp | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Code/Game/GameProtocols/ObjectProtocols.h b/Code/Game/GameProtocols/ObjectProtocols.h index 1baf2654..70e24883 100644 --- a/Code/Game/GameProtocols/ObjectProtocols.h +++ b/Code/Game/GameProtocols/ObjectProtocols.h @@ -478,7 +478,7 @@ namespace GameLogic { /** @todo TODO: not implemented */ } - Protocol_ObjectCreate(float p[3], float r[4], int id, char *path) + Protocol_ObjectCreate(float p[3], float r[4], float s[3], int id, char *path) { this->protocol[0].value = protocol_Gameplay_ObjectCreate; this->protocol[0].type = Oyster::Network::NetAttributeType_Int; @@ -502,8 +502,9 @@ namespace GameLogic object_ID = id; this->name = path; - memset(this->position, 0, sizeof(float) * 3); - memset(this->rotationQ, 0, sizeof(float) * 4); + memcpy(this->position, p, sizeof(float) * 3); + memcpy(this->rotationQ, r, sizeof(float) * 4); + memcpy(this->scale, s, sizeof(float) * 3); } Oyster::Network::CustomNetProtocol GetProtocol() override { diff --git a/Code/Game/GameServer/Implementation/GameSession_General.cpp b/Code/Game/GameServer/Implementation/GameSession_General.cpp index f76428d8..cc15b9c1 100644 --- a/Code/Game/GameServer/Implementation/GameSession_General.cpp +++ b/Code/Game/GameServer/Implementation/GameSession_General.cpp @@ -157,7 +157,10 @@ namespace DanBias if((this->clients[k] && readyList[i]) && readyList[i]->GetClient()->GetID() != this->clients[k]->GetClient()->GetID()) { //Protocol_ObjectCreatePlayer - Protocol_ObjectCreate p(this->clients[k]->GetPlayer()->GetOrientation(), this->clients[k]->GetPlayer()->GetID(), "char_white.dan"); //The model name will be custom later.. + Protocol_ObjectCreate p( this->clients[k]->GetPlayer()->GetPosition(), + this->clients[k]->GetPlayer()->GetRotation(), + this->clients[k]->GetPlayer()->GetScale(), + this->clients[k]->GetPlayer()->GetID(), "char_white.dan"); //The model name will be custom later.. readyList[i]->GetClient()->Send(p); } }