Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @description
- for (var i = 0; i < array_length(inv); ++i) {
- if (inv[i].cellType == objectTypes.any) {
- if (inv[i].id == noone
- or inv[i].id == other.object_index and inv[i].stack + other.quantity <= inv[i].maxStack)
- {
- inv[i].name = other.name;
- inv[i].id = other.object_index;
- inv[i].sprite = other.sprite_index;
- inv[i].type = other.type;
- inv[i].stack += other.quantity;
- inv[i].maxStack = other.maxStack;
- with other instance_destroy();
- break;
- }
- else if (inv[i].id == other.object_index and inv[i].stack + other.quantity > inv[i].maxStack) {
- other.quantity -= inv[i].maxStack - inv[i].stack;
- inv[i].stack = inv[i].maxStack;
- }
- }
- else if other.type == inv[i].cellType {
- if inv[i].id == noone {
- inv[i].name = other.name;
- inv[i].id = other.object_index;
- inv[i].sprite = other.sprite_index;
- inv[i].type = other.type;
- inv[i].stack = 1;
- inv[i].maxStack = other.maxStack;
- other.quantity -= 1;
- if (other.quantity <= 0) with other instance_destroy();
- break;
- }
- }
- }
- event_user(3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement