summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-01-30 16:19:31 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-01-30 16:19:31 +0000
commit4fdf699da7e0f80e4d66fb54a9aa5783fba9b6ff (patch)
tree8bcff911a0008309d17434722abf315c053aa511 /src/map/intif.c
parent07e50b28bf6cdfe0d9fcb2c3fd48fe74e68b2470 (diff)
downloadhercules-4fdf699da7e0f80e4d66fb54a9aa5783fba9b6ff.tar.gz
hercules-4fdf699da7e0f80e4d66fb54a9aa5783fba9b6ff.tar.bz2
hercules-4fdf699da7e0f80e4d66fb54a9aa5783fba9b6ff.tar.xz
hercules-4fdf699da7e0f80e4d66fb54a9aa5783fba9b6ff.zip
- Autoloot now uses the item's base drop chance rather than final drop rate to determine if it should autoloot the item or not.
- Fixed super novices getting +10 to all stats temporarily whentheir death count isn't zero. - Fixed Kahai displaying HP-SP as the total healed instead of HP - Cleaned up skill_repairweapon to prevent crashes when the target vanishes/changes/whatever before the weapon to repair has been selected. - Parsing the Storage/Guild Storage from the char server will now fail if the storage has been modified and not saved yet. - Being hit now cancels confuse. - Added back the bleeding icon. - Fixed Combo Finish Soul Linked Effect being a 11x11 area o.O git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5121 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c89
1 files changed, 52 insertions, 37 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index 6b53d5c0d..0046d0c0c 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -902,24 +902,29 @@ int intif_parse_LoadStorage(int fd) {
struct storage *stor;
struct map_session_data *sd;
RFIFOHEAD(fd);
-
+
+ sd=map_id2sd( RFIFOL(fd,4) );
+ if(sd==NULL){
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
+ return 1;
+ }
+
stor = account2storage( RFIFOL(fd,4));
if (stor->storage_status == 1) { // Already open.. lets ignore this update
if (battle_config.error_log)
- ShowWarning("intif_parse_LoadStorage: storage received for a client already open\n");
- return 0;
+ ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
}
-
- if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
+ if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
if (battle_config.error_log)
- ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
+ ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
return 1;
}
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- if(battle_config.error_log)
- ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
+ if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
+ if (battle_config.error_log)
+ ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
return 1;
}
if(battle_config.save_log)
@@ -952,34 +957,44 @@ int intif_parse_LoadGuildStorage(int fd)
int guild_id;
RFIFOHEAD(fd);
guild_id = RFIFOL(fd,8);
- if(guild_id > 0) {
- gstor=guild2storage(guild_id);
- if(!gstor) {
- if(battle_config.error_log)
- ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
- return 1;
- }
- if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
- gstor->storage_status = 0;
- if(battle_config.error_log)
- ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
- return 1;
- }
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- if(battle_config.error_log)
- ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
- return 1;
- }
- if(battle_config.save_log)
- ShowInfo("intif_open_guild_storage: %d\n",RFIFOL(fd,4) );
- memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
- gstor->storage_status = 1;
- sd->state.storage_flag = 2;
- clif_guildstorageitemlist(sd,gstor);
- clif_guildstorageequiplist(sd,gstor);
- clif_updateguildstorageamount(sd,gstor);
+ if(guild_id <= 0)
+ return 1;
+ sd=map_id2sd( RFIFOL(fd,4) );
+ if(sd==NULL){
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
+ return 1;
+ }
+ gstor=guild2storage(guild_id);
+ if(!gstor) {
+ if(battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
+ return 1;
}
+ if (gstor->storage_status == 1) { // Already open.. lets ignore this update
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
+ gstor->storage_status = 0;
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
+ return 1;
+ }
+ if(battle_config.save_log)
+ ShowInfo("intif_open_guild_storage: %d\n",RFIFOL(fd,4) );
+ memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
+ gstor->storage_status = 1;
+ sd->state.storage_flag = 2;
+ clif_guildstorageitemlist(sd,gstor);
+ clif_guildstorageequiplist(sd,gstor);
+ clif_updateguildstorageamount(sd,gstor);
return 0;
}
int intif_parse_SaveGuildStorage(int fd)