summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-18 20:16:28 -0200
committershennetsind <ind@henn.et>2015-01-18 20:16:28 -0200
commit0957abd4d19b82b8dc8d7db2743008fa3daff3fa (patch)
treef779d6c89a85fb66ab86b3e1fa0f2a35246baf24 /src/map/atcommand.c
parenteb75dc692321954912d3befcdfb45d2f1898eaa4 (diff)
downloadhercules-0957abd4d19b82b8dc8d7db2743008fa3daff3fa.tar.gz
hercules-0957abd4d19b82b8dc8d7db2743008fa3daff3fa.tar.bz2
hercules-0957abd4d19b82b8dc8d7db2743008fa3daff3fa.tar.xz
hercules-0957abd4d19b82b8dc8d7db2743008fa3daff3fa.zip
To help pinpoint and manage the issue report in 8402
@cddebug command; broken entries will be normalized immediately, to forcefully reset the cooldown write "reset" i.e. @cddebug reset, to use on others the usual #cddebug "target" http://hercules.ws/board/tracker/issue-8402-serious-problem-with-skill-that-cant-be-cast-or-used/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 000192b62..34ef4ec30 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -9315,6 +9315,50 @@ ACMD(skdebug) {
return true;
}
/**
+ * cooldown-debug
+ **/
+ACMD(cddebug) {
+ int i;
+ struct skill_cd* cd = NULL;
+
+ if( !(cd = idb_get(skill->cd_db,sd->status.char_id)) ) {
+ clif->message(fd,"No cool down list found");
+ } else {
+ clif->messages(fd,"Found %d registered cooldowns",cd->cursor);
+ for(i = 0; i < cd->cursor; i++) {
+ if( cd->entry[i] ) {
+ const struct TimerData *td = timer->get(cd->entry[i]->timer);
+
+ if( !td || td->func != skill->blockpc_end ) {
+ clif->messages(fd,"Found invalid entry in slot %d for skill %s",i,skill->db[cd->entry[i]->skidx].name);
+ sd->blockskill[cd->entry[i]->skidx] = false;
+ }
+ }
+ }
+ }
+
+ if( !cd || (message && *message && strcmpi(message,"reset")) ) {
+ for(i = 0; i < MAX_SKILL; i++) {
+ if( sd->blockskill[i] ) {
+ clif->messages(fd,"Found skill '%s', unblocking...",skill->db[i].name);
+ sd->blockskill[i] = false;
+ }
+ }
+ if( cd ) {//reset
+ for(i = 0; i < cd->cursor; i++) {
+ if( !cd->entry[i] ) continue;
+ timer->delete(cd->entry[i]->timer,skill->blockpc_end);
+ ers_free(skill->cd_entry_ers, cd->entry[i]);
+ }
+
+ idb_remove(skill->cd_db,sd->status.char_id);
+ ers_free(skill->cd_ers, cd);
+ }
+ }
+
+ return true;
+}
+/**
* Fills the reference of available commands in atcommand DBMap
**/
#define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL, NULL, true }
@@ -9583,6 +9627,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(searchstore),
ACMD_DEF(costume),
ACMD_DEF(skdebug),
+ ACMD_DEF(cddebug),
};
int i;