summaryrefslogtreecommitdiff
path: root/src/common/console.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-04 20:36:29 -0300
committershennetsind <ind@henn.et>2013-05-04 20:36:29 -0300
commit3bfadf4d2329da54f2097e1f0fafba371347465f (patch)
tree6164b506bb8591979c77d459ad3b7d6f521d424b /src/common/console.c
parent18b1965ce16909613f0a53515d40553742082ce2 (diff)
downloadhercules-3bfadf4d2329da54f2097e1f0fafba371347465f.tar.gz
hercules-3bfadf4d2329da54f2097e1f0fafba371347465f.tar.bz2
hercules-3bfadf4d2329da54f2097e1f0fafba371347465f.tar.xz
hercules-3bfadf4d2329da54f2097e1f0fafba371347465f.zip
Mapreg saving overhaul
Server only saves variables that were changed, not all of them. Special Thanks to Yommy <3~! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/console.c')
-rw-r--r--src/common/console.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/common/console.c b/src/common/console.c
index c228ab790..248dd7b45 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -337,15 +337,16 @@ int console_parse_timer(int tid, unsigned int tick, int id, intptr_t data) {
return 0;
}
void console_parse_final(void) {
- InterlockedDecrement(&console->ptstate);
- racond_signal(console->ptcond);
-
- /* wait for thread to close */
- rathread_wait(console->pthread, NULL);
-
- racond_destroy(console->ptcond);
- ramutex_destroy(console->ptmutex);
-
+ if( console->ptstate ) {
+ InterlockedDecrement(&console->ptstate);
+ racond_signal(console->ptcond);
+
+ /* wait for thread to close */
+ rathread_wait(console->pthread, NULL);
+
+ racond_destroy(console->ptcond);
+ ramutex_destroy(console->ptmutex);
+ }
}
void console_parse_init(void) {
cinput.count = 0;