revert: part of changes with bot icons (ref #424)
This commit is contained in:
parent
58111bfd32
commit
4b9acd5d5c
1 changed files with 4 additions and 5 deletions
|
|
@ -952,12 +952,11 @@ void Bot::showChaterIcon (bool show) {
|
|||
return;
|
||||
}
|
||||
|
||||
auto sendBotVoice = [&show] (edict_t *ent, int ownId) {
|
||||
auto sendBotVoice = [] (bool on, edict_t *ent, int ownId) {
|
||||
MessageWriter (MSG_ONE, msgs.id (NetMsg::BotVoice), nullptr, ent) // begin message
|
||||
.writeByte (show) // switch on/off
|
||||
.writeByte (on) // switch on/off
|
||||
.writeByte (ownId);
|
||||
};
|
||||
|
||||
int ownIndex = index ();
|
||||
|
||||
for (auto &client : util.getClients ()) {
|
||||
|
|
@ -966,13 +965,13 @@ void Bot::showChaterIcon (bool show) {
|
|||
}
|
||||
|
||||
if (!show && (client.iconFlags[ownIndex] & ClientFlags::Icon) && client.iconTimestamp[ownIndex] < game.time ()) {
|
||||
sendBotVoice (client.ent, entindex ());
|
||||
sendBotVoice (false, client.ent, entindex ());
|
||||
|
||||
client.iconTimestamp[ownIndex] = 0.0f;
|
||||
client.iconFlags[ownIndex] &= ~ClientFlags::Icon;
|
||||
}
|
||||
else if (show && !(client.iconFlags[ownIndex] & ClientFlags::Icon)) {
|
||||
sendBotVoice (client.ent, entindex ());
|
||||
sendBotVoice (true, client.ent, entindex ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue