summaryrefslogtreecommitdiff
path: root/src/modules/m_cloaking.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-10-11 12:21:16 +0100
committerPeter Powell <petpow@saberuk.com>2019-10-13 22:05:19 +0100
commitdd24f8ac713793d5d5a7e959228937f48788ba66 (patch)
tree1f55ed9c83ad62acdb628f77f0b347044f26d61a /src/modules/m_cloaking.cpp
parentf751aef21057d8b4be40cdb697982ea3e53e992c (diff)
Convert a bunch of LocalUser* casts to IS_LOCAL.
This is a lot safer and handles users changing servers properly.
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r--src/modules/m_cloaking.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index c5db9ff8a..eab28db4a 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -375,12 +375,14 @@ class ModuleCloaking : public Module
{
u->SetMode(cu, false);
- if (!IS_LOCAL(u))
+ LocalUser* luser = IS_LOCAL(u);
+ if (!luser)
return;
+
Modes::ChangeList modechangelist;
modechangelist.push_remove(&cu);
ClientProtocol::Events::Mode modeevent(ServerInstance->FakeClient, NULL, u, modechangelist);
- static_cast<LocalUser*>(u)->Send(modeevent);
+ luser->Send(modeevent);
}
cu.active = false;
}