From e8a475419f042d3d175412c140c05477f137108f Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Wed, 6 Dec 2023 16:36:21 -0500 Subject: [PATCH] 2112 by PUSH. --- SQCSim-common/netprotocol.cpp | 6 +++++- SQCSim2021/engine.cpp | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/SQCSim-common/netprotocol.cpp b/SQCSim-common/netprotocol.cpp index 6159739..a8c5c9d 100644 --- a/SQCSim-common/netprotocol.cpp +++ b/SQCSim-common/netprotocol.cpp @@ -930,7 +930,11 @@ bool netprot::Deserialize(Chat* chat, char* buf, uint32_t *buflen) { std::cout << messsize << ": " << &buf[1 + sizeof(uint64_t) * 3] << std::endl; - strcpy(chat->mess, messsize, &buf[1 + sizeof(uint64_t) * 3]); + char* ciboire = &buf[1 + sizeof(uint64_t) * 3]; + + std::cout << ciboire << std::endl; + + strcpy(chat->mess, 140, ciboire); //*buflen = messsize + sizeof(uint64_t) * 3 + 1; diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 13c19a9..03bbdd2 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1419,7 +1419,7 @@ void Engine::Render(float elapsedTime) { if (m_syncs.count(sync.timestamp)) { Sync comp = m_syncs[sync.timestamp]; - std::cout << "HP: " << sync.hp << std::endl; + //std::cout << "HP: " << sync.hp << std::endl; //m_player.InflictDamage(sync.hp - comp.hp); Vector3f diff = sync.position - comp.position; @@ -1436,7 +1436,7 @@ void Engine::Render(float elapsedTime) { m_syncs.erase(sync.timestamp); } - else SystemNotification("sync be no good."); + //else SystemNotification("sync be no good."); } break; case OUTPUT: @@ -1473,6 +1473,7 @@ void Engine::Render(float elapsedTime) { else if (x == MAX_BULLETS - 1) { // S'il y a pas d'espace dans l'array, prendre la place de la première balle de l'array. m_bullets[0]->~Bullet(); m_bullets[0] = bult; + break; } m_audio.Create3DAudioObj(m_powpow, AUDIO_PATH "pow.wav", bull.pos, bull.dir * 10, false, .5f); }