mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Save error handling clean up
This commit is contained in:
parent
2d7886bf33
commit
7146eb572b
|
@ -398,6 +398,8 @@ bool CSaveTeam::HandleSaveError(int Result, int ClientID, CGameContext *pGameCon
|
|||
{
|
||||
switch(Result)
|
||||
{
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
pGameContext->SendChatTarget(ClientID, "You have to be in a team (from 1-63)");
|
||||
break;
|
||||
|
@ -408,12 +410,12 @@ bool CSaveTeam::HandleSaveError(int Result, int ClientID, CGameContext *pGameCon
|
|||
pGameContext->SendChatTarget(ClientID, "Unable to find all Characters");
|
||||
break;
|
||||
case 4:
|
||||
pGameContext->SendChatTarget(ClientID, "Your team is not started yet");
|
||||
pGameContext->SendChatTarget(ClientID, "Your team has not started yet");
|
||||
break;
|
||||
default: // this state should never be reached
|
||||
pGameContext->SendChatTarget(ClientID, "Unknown error while saving");
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ public:
|
|||
int load(int Team);
|
||||
CSaveTee* m_pSavedTees;
|
||||
|
||||
// returns true if an error occured
|
||||
static bool HandleSaveError(int Result, int ClientID, CGameContext *pGameContext);
|
||||
private:
|
||||
int MatchPlayer(char name[16]);
|
||||
|
|
Loading…
Reference in a new issue