summaryrefslogtreecommitdiff
path: root/modules/core/cs_set_xop.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-16 12:41:17 -0400
committerAdam <Adam@anope.org>2010-09-16 12:41:17 -0400
commitccc6109879617f4fc910bd78d395b9eee4300a2e (patch)
tree1c2951d8f48cd3ed78821a1972a75d2392fdf0bd /modules/core/cs_set_xop.cpp
parent813185105823daa6a1b574d86053950382343589 (diff)
Fixed crash on setting XOP on
Diffstat (limited to 'modules/core/cs_set_xop.cpp')
-rw-r--r--modules/core/cs_set_xop.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/core/cs_set_xop.cpp b/modules/core/cs_set_xop.cpp
index e08b014a1..d0c448228 100644
--- a/modules/core/cs_set_xop.cpp
+++ b/modules/core/cs_set_xop.cpp
@@ -39,9 +39,9 @@ class CommandCSSetXOP : public Command
{
ChanAccess *access;
- for (unsigned i = ci->GetAccessCount() - 1; 0 <= i; --i)
+ for (unsigned i = ci->GetAccessCount(); i > 0; --i)
{
- access = ci->GetAccess(i);
+ access = ci->GetAccess(i - 1);
/* This will probably cause wrong levels to be set, but hey,
* it's better than losing it altogether.
@@ -57,7 +57,7 @@ class CommandCSSetXOP : public Command
else if (CHECKLEV(CA_AUTOVOICE) || CHECKLEV(CA_VOICE) || CHECKLEV(CA_VOICEME))
access->level = ACCESS_VOP;
else
- ci->EraseAccess(i);
+ ci->EraseAccess(i - 1);
}
reset_levels(ci);