From deb290af0f0200d530ba10e4c6c3f6a45b4971c5 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 26 Jul 2006 20:53:08 +0000 Subject: Fix reiterpret_cast stuff that doesnt work right git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4548 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 9f02af689..f14cc69de 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3923,12 +3923,21 @@ class ModuleSpanningTree : public Module if (params->size() < 2) return; // Insert the TS value of the object, either userrec or chanrec - classbase* a = reinterpret_cast(Srv->FindNick((*params)[0])); - if (!a) + time_t ourTS = 0; + userrec* a = Srv->FindNick((*params)[0]); + if (a) { - a = reinterpret_cast(Srv->FindChannel((*params)[0])); + ourTS = a->age; + } + else + { + chanrec* a = Srv->FindChannel((*params)[0]); + if (a) + { + ourTS = a->age; + } } - params->insert(params->begin() + 1,ConvToStr(a->age)); + params->insert(params->begin() + 1,ConvToStr(ourTS)); DoOneToMany(Srv->GetServerName(),"FMODE",*params); } } -- cgit v1.2.3