mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Multiline tune zone messages
This commit is contained in:
parent
f8b15e1e62
commit
29db455131
|
@ -3,7 +3,7 @@ tune_zone_leave 0 "Leaving beloved standards behind"
|
|||
tune_zone 1 hook_drag_accel -3
|
||||
tune_zone 1 gun_speed 100
|
||||
|
||||
tune_zone_enter 2 "Space !"
|
||||
tune_zone_enter 2 "Space!\nMultiple lines!"
|
||||
tune_zone 2 gravity 0
|
||||
tune_zone 2 air_friction 1
|
||||
tune_zone 2 ground_friction 1
|
||||
|
|
|
@ -1787,10 +1787,32 @@ void CCharacter::HandleTuneLayer()
|
|||
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // send specific tunings
|
||||
// send zone leave msg
|
||||
if (GameServer()->m_ZoneLeaveMsg[m_TuneZoneOld])
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), GameServer()->m_ZoneLeaveMsg[m_TuneZoneOld]);
|
||||
{
|
||||
const char* cur = GameServer()->m_ZoneLeaveMsg[m_TuneZoneOld];
|
||||
const char* pos;
|
||||
while ((pos = str_find(cur, "\\n"))) {
|
||||
char aBuf[256];
|
||||
str_copy(aBuf, cur, pos - cur + 1);
|
||||
aBuf[pos - cur + 1] = '\0';
|
||||
cur = pos + 2;
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), aBuf);
|
||||
}
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), cur);
|
||||
}
|
||||
// send zone enter msg
|
||||
if (GameServer()->m_ZoneEnterMsg[m_TuneZone])
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), GameServer()->m_ZoneEnterMsg[m_TuneZone]);
|
||||
{
|
||||
const char* cur = GameServer()->m_ZoneEnterMsg[m_TuneZone];
|
||||
const char* pos;
|
||||
while ((pos = str_find(cur, "\\n"))) {
|
||||
char aBuf[256];
|
||||
str_copy(aBuf, cur, pos - cur + 1);
|
||||
aBuf[pos - cur + 1] = '\0';
|
||||
cur = pos + 2;
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), aBuf);
|
||||
}
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue