summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/chrif.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 232b53569..e47deeb25 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6440,7 +6440,7 @@ int atcommand_charjailtime(const int fd, struct map_session_data* sd, const char
clif_displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
- if (pc_isGM(pl_sd) < pc_isGM(sd)) {
+ if (pc_isGM(pl_sd) >= pc_isGM(sd)) {
clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player.
return -1;
}
diff --git a/src/map/chrif.c b/src/map/chrif.c
index e19f66126..403cfdcb1 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -496,7 +496,18 @@ void chrif_authreq(struct map_session_data *sd)
//character selected, insert into auth db
void chrif_authok(int fd) {
struct auth_node *auth_data;
+ TBL_PC* sd;
RFIFOHEAD(fd);
+ //Check if we don't already have player data in our server
+ //(prevents data that is to be saved from being overwritten by
+ //this received status data if this auth is later successful) [Skotlex]
+ if ((sd = map_id2sd(RFIFOL(fd, 4))) != NULL)
+ {
+ struct mmo_charstatus *status = (struct mmo_charstatus *)RFIFOP(fd, 20);
+ //Auth check is because this could be the very same sd that is waiting char-server authorization.
+ if (sd->state.auth && sd->status.char_id == status->char_id)
+ return;
+ }
if ((auth_data =uidb_get(auth_db, RFIFOL(fd, 4))) != NULL)
{ //Is the character already awaiting authorization?