summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/map/chrif.c
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip
Minor fixes and tweaks suggested by cppcheck
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 153216cef..fd12ed013 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -655,9 +655,9 @@ void chrif_authfail(int fd) {/* HELLO WORLD. ip in RFIFOL 15 is not being used (
*/
int auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
struct auth_node *node = DB->data2ptr(data);
- const char* states[] = { "Login", "Logout", "Map change" };
if(DIFF_TICK(timer->gettick(),node->node_created)>60000) {
+ const char* states[] = { "Login", "Logout", "Map change" };
switch (node->state) {
case ST_LOGOUT:
//Re-save attempt (->sd should never be null here).
@@ -1148,7 +1148,6 @@ bool chrif_load_scdata(int fd) {
#ifdef ENABLE_SC_SAVING
struct map_session_data *sd;
- struct status_change_data *data;
int aid, cid, i, count;
aid = RFIFOL(fd,4); //Player Account ID
@@ -1169,7 +1168,7 @@ bool chrif_load_scdata(int fd) {
count = RFIFOW(fd,12); //sc_count
for (i = 0; i < count; i++) {
- data = (struct status_change_data*)RFIFOP(fd,14 + i*sizeof(struct status_change_data));
+ struct status_change_data *data = (struct status_change_data*)RFIFOP(fd,14 + i*sizeof(struct status_change_data));
status->change_start(NULL, &sd->bl, (sc_type)data->type, 10000, data->val1, data->val2, data->val3, data->val4,
data->tick, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK|SCFLAG_LOADED|SCFLAG_FIXEDRATE);
}