Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Hercules Ultimate Storage System (HUSS) #3330

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift click to select a range
1ffe6ad
Implementation of the Hercules Ultimate Storage System
jasonch35 Nov 4, 2024
0a930b5
Add SQL files for main db and upgrades
jasonch35 Nov 4, 2024
d403047
Add data on message tables for the updated atcommands
jasonch35 Nov 4, 2024
520001b
Storage configuration
jasonch35 Nov 4, 2024
95d6f76
Update NPC scripts to comply with new command
jasonch35 Nov 4, 2024
98ad026
Update script and atcommand documentation
jasonch35 Nov 4, 2024
0cb567d
Update HPM Hooks
jasonch35 Nov 4, 2024
4aea3a4
Show warning if storage capacity is over MAX_STORAGE
jasonch35 Nov 5, 2024
c8947dc
Use cart function when storing from cart
jasonch35 Nov 21, 2024
c5e746a
Indexed storage_id column from storage sql table
jasonch35 Dec 1, 2024
41528de
Char-server to ignore storage sizes and hardcoded to MAX_STORAGE instead
jasonch35 Dec 1, 2024
6e485b3
Moved storage_settings struct from mmo to storage header
jasonch35 Dec 1, 2024
1dccefc
Added access modes argument for storage->open
jasonch35 Dec 1, 2024
8baf55b
Refactored atcommands logic
jasonch35 Dec 1, 2024
973f6f6
Missed name parameter in clif.c
jasonch35 Dec 1, 2024
dcdd63c
Fixed invalid storage(0) assertion
jasonch35 Dec 1, 2024
49997aa
Indentation/space fix
jasonch35 Dec 1, 2024
645b77a
PCCHECK_STORAGE check fix
jasonch35 Dec 1, 2024
d6adf1b
Initialization logic fix
jasonch35 Dec 1, 2024
007a858
Removed unnecessary cleaning of VECTOR
jasonch35 Dec 1, 2024
1c34316
Removed full storage checks for functions that calls storage->additem()
jasonch35 Dec 1, 2024
a919fd8
Set constant at the end of every iteration at config reading
jasonch35 Dec 1, 2024
53baf8b
Update HPM Hooks
jasonch35 Dec 1, 2024
e882183
Messagetable update
jasonch35 Dec 1, 2024
dc85a3e
Proper code styling for asterisks
jasonch35 Dec 1, 2024
3ec152b
Clif update storage amount window to capacity
jasonch35 Dec 1, 2024
8df6252
Corrected documentation
jasonch35 Dec 1, 2024
9f08c77
Storage config reading
jasonch35 Dec 11, 2024
8eaf684
Removed redundant assignment
jasonch35 Jan 2, 2025
761ea97
Clear item list for every storage at unit freeing
jasonch35 Jan 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Storage config reading
- Check duplicate for non imported storage ID and overwrite when imported ID exist
- Move vector initialization on do_init_storage and transferred config reading after it
  • Loading branch information
jasonch35 committed Dec 11, 2024
commit 9f08c77a4a4a41c9ea0bd85a9ff678043961edb0
1 change: 0 additions & 1 deletion src/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -7028,7 7028,6 @@ int do_init(int argc, char *argv[])
atcommand->msg_read(map->MSG_CONF_NAME, false);
map->inter_config_read(map->INTER_CONF_NAME, false);
logs->config_read(map->LOG_CONF_NAME, false);
storage->config_read(map->STORAGE_CONF_FILENAME, false);
} else {
battle->config_read(map->BATTLE_CONF_FILENAME, false);
}
Expand Down
16 changes: 10 additions & 6 deletions src/map/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 1009,7 @@ bool storage_config_read(const char *filename, bool imported)
nullpo_retr(false, filename);

if (!imported)
VECTOR_INIT(storage->configuration);
VECTOR_CLEAR(storage->configuration);

struct config_t stor_libconf;
if (libconfig->load_file(&stor_libconf, filename) == CONFIG_FALSE)
Expand All @@ -1035,11 1035,13 @@ bool storage_config_read(const char *filename, bool imported)
}

// Duplicate ID search and report...
int d = 0;
ARR_FIND(0, VECTOR_LENGTH(storage->configuration), d, VECTOR_INDEX(storage->configuration, d).uid == s_conf.uid);
if (d < VECTOR_LENGTH(storage->configuration)) {
ShowError("storage_config_read: Duplicate ID %d for storage. Skipping...\n", s_conf.uid);
continue;
if (!imported) {
int d = 0;
ARR_FIND(0, VECTOR_LENGTH(storage->configuration), d, VECTOR_INDEX(storage->configuration, d).uid == s_conf.uid);
if (d < VECTOR_LENGTH(storage->configuration)) {
ShowError("storage_config_read: Duplicate ID %d for storage. Skipping...\n", s_conf.uid);
continue;
}
}

// Check for an invalid ID...
Expand Down Expand Up @@ -1117,6 1119,8 @@ static void do_init_storage(bool minimal)
{
if (minimal)
return;
VECTOR_INIT(storage->configuration);
storage->config_read(map->STORAGE_CONF_FILENAME, false);
}

/**
Expand Down
Loading