Resolved Guild Storage Expansion not updating (#3321)

* Fixes #3317.
* Resolves the Guild Storage Expansion skill not refreshing the map server cached data.
* Updated some inter server checks to grab the proper max size of guild storages.
Thanks to @admkakaroto and @Lemongrass3110!
This commit is contained in:
Aleos 2018-07-18 17:10:07 -04:00 committed by GitHub
parent 8a353697b0
commit bbe552d1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,7 @@
#include "char.hpp" #include "char.hpp"
#include "inter.hpp" #include "inter.hpp"
#include "int_guild.hpp"
/** /**
* Check if storage ID is valid * Check if storage ID is valid
@ -135,7 +136,7 @@ bool storage_fromsql(uint32 account_id, struct s_storage* p)
bool guild_storage_tosql(int guild_id, struct s_storage* p) bool guild_storage_tosql(int guild_id, struct s_storage* p)
{ {
//ShowInfo("Guild Storage has been saved (GID: %d)\n", guild_id); //ShowInfo("Guild Storage has been saved (GID: %d)\n", guild_id);
return char_memitemdata_to_sql(p->u.items_guild, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE, p->stor_id); return char_memitemdata_to_sql(p->u.items_guild, inter_guild_storagemax(guild_id), guild_id, TABLE_GUILD_STORAGE, p->stor_id);
} }
/** /**
@ -146,7 +147,7 @@ bool guild_storage_tosql(int guild_id, struct s_storage* p)
*/ */
bool guild_storage_fromsql(int guild_id, struct s_storage* p) bool guild_storage_fromsql(int guild_id, struct s_storage* p)
{ {
return char_memitemdata_from_sql( p, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE, p->stor_id ); return char_memitemdata_from_sql( p, inter_guild_storagemax(guild_id), guild_id, TABLE_GUILD_STORAGE, p->stor_id );
} }
void inter_storage_checkDB(void) { void inter_storage_checkDB(void) {

View File

@ -603,7 +603,11 @@ char storage_guild_storageopen(struct map_session_data* sd)
return GSTORAGE_ALREADY_OPEN; return GSTORAGE_ALREADY_OPEN;
} }
if((gstor = guild2storage2(sd->status.guild_id)) == NULL) { if((gstor = guild2storage2(sd->status.guild_id)) == nullptr
#ifdef OFFICIAL_GUILD_STORAGE
|| (gstor->max_amount != guild_checkskill(sd->guild, GD_GUILD_STORAGE) * 100)
#endif
) {
intif_request_guild_storage(sd->status.account_id,sd->status.guild_id); intif_request_guild_storage(sd->status.account_id,sd->status.guild_id);
return GSTORAGE_OPEN; return GSTORAGE_OPEN;
} }