msg: use StatusIcon message to detect if bot has a defusal kit (ref #589)

This commit is contained in:
jeefo 2024-06-24 11:37:24 +03:00
commit 690c4d660c
No known key found for this signature in database
GPG key ID: D696786B81B667C8
2 changed files with 6 additions and 1 deletions

View file

@ -61,7 +61,8 @@ CR_DECLARE_SCOPED_ENUM (StatusIconCache,
Escape = cr::bit (2), Escape = cr::bit (2),
Rescue = cr::bit (3), Rescue = cr::bit (3),
VipSafety = cr::bit (4), VipSafety = cr::bit (4),
C4 = cr::bit (5) C4 = cr::bit (5),
Defuser = cr::bit (6)
) )
class MessageDispatcher final : public Singleton <MessageDispatcher> { class MessageDispatcher final : public Singleton <MessageDispatcher> {

View file

@ -267,6 +267,9 @@ void MessageDispatcher::netMsgStatusIcon () {
else if (cached & StatusIconCache::C4) { else if (cached & StatusIconCache::C4) {
m_bot->m_inBombZone = (m_args[enabled].long_ == 2); m_bot->m_inBombZone = (m_args[enabled].long_ == 2);
} }
else if (cached && StatusIconCache::Defuser) {
m_bot->m_hasDefuser = (m_args[enabled].long_ != 0);
}
} }
void MessageDispatcher::netMsgDeathMsg () { void MessageDispatcher::netMsgDeathMsg () {
@ -501,6 +504,7 @@ MessageDispatcher::MessageDispatcher () {
m_statusIconCache["rescue"] = StatusIconCache::NeedHandle | StatusIconCache::Rescue; m_statusIconCache["rescue"] = StatusIconCache::NeedHandle | StatusIconCache::Rescue;
m_statusIconCache["vipsafety"] = StatusIconCache::NeedHandle | StatusIconCache::VipSafety; m_statusIconCache["vipsafety"] = StatusIconCache::NeedHandle | StatusIconCache::VipSafety;
m_statusIconCache["c4"] = StatusIconCache::NeedHandle | StatusIconCache::C4; m_statusIconCache["c4"] = StatusIconCache::NeedHandle | StatusIconCache::C4;
m_statusIconCache["defuser"] = StatusIconCache::NeedHandle | StatusIconCache::Defuser;
// register team info cache // register team info cache
m_teamInfoCache["TERRORIST"] = Team::Terrorist; m_teamInfoCache["TERRORIST"] = Team::Terrorist;