if(src.stackable)
var/obj/object = locate(text2path("[src.type]")) in M.contents
if(object)
if(object.amount>=object.a_max) return
object.amount++
...(rest of code)
CURRENTLY:
Checks if obj is stackable.
Locates object in M.contents.
IF obj, then; IF amount < obj max amount, code runs correctly.
HOW TO:
With this current system, the check simply haults if(object.amount>=object.a_max) returns 1.
I want the the proc to check if there is another object inside M.contents that is also the same type
as the original obj, then have that second object run the same if(object.amount>=object.a_max) as the original.
What is the best way to accomplish this without using nested-IF statements? If doing so, the proc would stop after only checking for two objects?