-
Notifications
You must be signed in to change notification settings - Fork 78
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
Merge TrapStats & ManfctrConfig with TrapConfigStats and ManfctrConfig with DoorConfigStats #3652
Conversation
@@ -3268,7 +3270,8 @@ long task_sell_traps_and_doors(struct Computer2 *comp, struct ComputerTask *ctas | |||
ERRORLOG("Internal error - invalid door model %d in slot %d",(int)model,(int)i); | |||
break; | |||
} | |||
if (dungeon->mnfct_info.door_amount_placeable[model] > 0) | |||
doorst = get_door_model_stats(model); | |||
if ((dungeon->mnfct_info.door_amount_placeable[model] > 0) && (doorst->unsellable == 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a check for unsellable to stop computer selling the unsellable. Let me know if you want to see this reverted.
@@ -3338,13 +3341,14 @@ long task_sell_traps_and_doors(struct Computer2 *comp, struct ComputerTask *ctas | |||
{ | |||
struct Thing *doortng; | |||
doortng = get_random_door_of_model_owned_by_and_locked(model, dungeon->owner, false); | |||
if (!thing_is_invalid(doortng)) { | |||
doorst = get_door_model_stats(doortng->model); | |||
if ((!thing_is_invalid(doortng)) && (doorst->unsellable == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing, check for unsellable added here.
@@ -3374,13 +3378,15 @@ long task_sell_traps_and_doors(struct Computer2 *comp, struct ComputerTask *ctas | |||
{ | |||
struct Thing *traptng; | |||
traptng = get_random_trap_of_model_owned_by_and_armed(model, dungeon->owner, true); | |||
if (!thing_is_invalid(traptng)) { | |||
trapst = get_trap_model_stats(traptng->model); | |||
if ((!thing_is_invalid(traptng)) && (trapst->unsellable == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also unsellable here.
{"PROPERTIES", 13}, | ||
{"SELLINGVALUE", 14}, | ||
{"UNSELLABLE", 15}, | ||
{"PLACESOUND", 16}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reorder I'm talking about, so it matches the order on trapdoor.cfg - It's pointless tho so it can be reverted if you don't like it. And of course for next addition if any, new stuff should still be added at end of list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind a reorder, if it still everything works.
don't notice anything else, so to me code looks fine |
destroy_door(thing); | ||
if (is_my_player_number(plyr_idx)) | ||
play_non_3d_sample(115); | ||
{ | ||
play_non_3d_sample(115); // TODO config make this sound configurable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a problem for the selling sound to be hardcoded. This is not a door specific thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a problem for the selling sound to be hardcoded. This is not a door specific thing.
I meant to make it configurable for everything, so doors/traps/rooms can have a different selling sound?
Plus reordered stuff around on trapdoor.cfg, added comments.
Also reordered
trapdoor_door_commands
on config_trapdoor.c - let me know if you wish to see this reverted but if you like it I might do the same thing later fortrapdoor_trap_commands
!If possible I would like to see #3635 merged before this PR, for convenience, but its whatever I will have to fix conflicts either way.