Remove support for the "LOOT" alias

This commit is contained in:
Oliver Hamlet
2023-08-17 23:39:26 +01:00
parent 2b95f26727
commit 86fee1892e
5 changed files with 39 additions and 112 deletions
+2 -8
View File
@@ -32,10 +32,9 @@ pub unsafe extern "C" fn lci_state_create(
state: *mut *mut lci_state,
game_type: c_int,
data_path: *const c_char,
loot_path: *const c_char,
) -> c_int {
catch_unwind(|| {
if state.is_null() || data_path.is_null() || loot_path.is_null() {
if state.is_null() || data_path.is_null() {
error(LCI_ERROR_INVALID_ARGS, "Null pointer passed")
} else {
let game_type = match map_game_type(game_type) {
@@ -48,13 +47,8 @@ pub unsafe extern "C" fn lci_state_create(
Err(e) => return e,
};
let loot_path = match to_str(loot_path) {
Ok(x) => PathBuf::from(x),
Err(e) => return e,
};
*state = Box::into_raw(Box::new(lci_state(RwLock::new(State::new(
game_type, data_path, loot_path,
game_type, data_path,
)))));
LCI_OK
+6 -6
View File
@@ -54,7 +54,7 @@ void test_lci_state_create() {
printf("testing lci_state_create()...\n");
lci_state * state = nullptr;
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, ".", ".");
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, ".");
assert(return_code == LCI_OK);
assert(state != nullptr);
@@ -66,7 +66,7 @@ void test_lci_condition_eval() {
printf("testing lci_condition_eval()...\n");
lci_state * state = nullptr;
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data", ".");
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data");
assert(return_code == LCI_OK);
assert(state != nullptr);
@@ -86,7 +86,7 @@ void test_lci_state_set_active_plugins() {
printf("testing lci_state_set_active_plugins()...\n");
lci_state * state = nullptr;
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data", ".");
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data");
assert(return_code == LCI_OK);
assert(state != nullptr);
@@ -118,7 +118,7 @@ void test_lci_state_set_plugin_versions() {
printf("testing lci_state_set_plugin_versions()...\n");
lci_state * state = nullptr;
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data", ".");
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data");
assert(return_code == LCI_OK);
assert(state != nullptr);
@@ -153,7 +153,7 @@ void test_lci_state_set_crc_cache() {
printf("testing lci_state_set_crc_cache()...\n");
lci_state * state = nullptr;
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data", ".");
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, "../../tests/testing-plugins/Oblivion/Data");
assert(return_code == LCI_OK);
assert(state != nullptr);
@@ -185,7 +185,7 @@ void test_lci_state_set_additional_data_paths() {
printf("testing lci_state_set_additional_data_paths()...\n");
lci_state * state = nullptr;
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, ".", ".");
int return_code = lci_state_create(&state, LCI_GAME_OBLIVION, ".");
assert(return_code == LCI_OK);
assert(state != nullptr);