From f01cb896e54f409883e333b7b279f0429ed70d82 Mon Sep 17 00:00:00 2001
From: Ghom <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 25 Apr 2020 02:43:56 +0200
Subject: [PATCH] Apply suggestions from code review
---
code/datums/components/storage/storage.dm | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm
index a51ccabe8f..aad6e8289f 100644
--- a/code/datums/components/storage/storage.dm
+++ b/code/datums/components/storage/storage.dm
@@ -495,20 +495,18 @@
host.add_fingerprint(M)
return FALSE
if(!length(can_hold_extra) || !is_type_in_typecache(I, can_hold_extra))
- if(length(can_hold))
- if(!is_type_in_typecache(I, can_hold))
- if(!stop_messages)
- to_chat(M, "[host] cannot hold [I]!")
- return FALSE
+ if(length(can_hold) && !is_type_in_typecache(I, can_hold))
+ if(!stop_messages)
+ to_chat(M, "[host] cannot hold [I]!")
+ return FALSE
if(is_type_in_typecache(I, cant_hold)) //Check for specific items which this container can't hold.
if(!stop_messages)
to_chat(M, "[host] cannot hold [I]!")
return FALSE
- if(storage_flags & STORAGE_LIMIT_MAX_W_CLASS)
- if(I.w_class > max_w_class)
- if(!stop_messages)
- to_chat(M, "[I] is too long for [host]!")
- return FALSE
+ if(storage_flags & STORAGE_LIMIT_MAX_W_CLASS && I.w_class > max_w_class)
+ if(!stop_messages)
+ to_chat(M, "[I] is too long for [host]!")
+ return FALSE
// STORAGE LIMITS
if(storage_flags & STORAGE_LIMIT_MAX_ITEMS)
if(real_location.contents.len >= max_items)