From 93cfad51258b84cf46bf2357733ccaaddb83ddbf Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Wed, 5 May 2004 05:41:51 +0000 Subject: [PATCH] Moved current grade to half of health int. --- stepmania/src/NetworkSyncManager.cpp | 18 ++++++------------ stepmania/src/NetworkSyncManager.h | 3 ++- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index 57fe800b17..a78887f6a5 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -208,7 +208,11 @@ void NetworkSyncManager::ReportScore(int playerID, int step, int score, int comb SendNetPack.m_combo=combo; SendNetPack.m_score=score; //Load packet with appropriate info SendNetPack.m_step=step-1; - SendNetPack.m_life=m_playerLife[playerID]; + + int CurGrade = g_CurStageStats.GetGrade((PlayerNumber)playerID); + + //Should be cleaned up + SendNetPack.m_life=m_playerLife[playerID] + CurGrade*65536; //Send packet to server NetPlayerClient->send((char*)&SendNetPack, sizeof(netHolder)); @@ -226,17 +230,7 @@ void NetworkSyncManager::ReportSongOver() SendNetPack.m_playerID = 21; // Song over Packet player ID - SendNetPack.m_step=0; - - FOREACH_EnabledPlayer( pn2 ) - { - if (pn2==PLAYER_1) - SendNetPack.m_step+=g_CurStageStats.GetGrade(pn2); - if (pn2==PLAYER_2) - SendNetPack.m_step+=g_CurStageStats.GetGrade(pn2)*256; - } - - + SendNetPack.m_step=0; SendNetPack.m_score=0; SendNetPack.m_combo=0; SendNetPack.m_life=0; diff --git a/stepmania/src/NetworkSyncManager.h b/stepmania/src/NetworkSyncManager.h index 0ecc9580b8..0d5599894b 100644 --- a/stepmania/src/NetworkSyncManager.h +++ b/stepmania/src/NetworkSyncManager.h @@ -69,7 +69,8 @@ private: int m_step; //SID (StepID, 0-6 for Miss to Marv, 7,8 for boo and ok) int m_score; //Player's Score int m_combo; //Player's Current Combo - int m_life; //Player's Life + int m_life; //Player's Life (AND GRADE) + //m_life = [16-bit int life] <- LSB [16-bit int grade] <-MSB }; struct netName //Data structure used for 16-character strings.