Page 1 of 1

Patch for Hackmover, to remove container size limit.

Posted: Fri Nov 21, 2008 1:26 pm
by zilpin
Quick and small patch to make hack mover never show WON'T FIT.
It annoys me, and I've seen other people request it.

Very Important Note:
This also (inadvertently) removes the recursion check when putting one container in another, so you may break your game by e.g. accidentally putting a bag in a chest, the chest in basket, then the basket into the bag.

Code: Select all

Index: drag.cc
===================================================================
--- drag.cc	(revision 6003)
+++ drag.cc	(working copy)
@@ -401,7 +401,7 @@
 	if (on_gump != gump)		// Not moving within same gump?
 		possible_theft = true;
 					// Add, and allow to combine.
-	if (!on_gump->add(to_drop, x, y, paintx, painty, false, true))
+	if (!on_gump->add(to_drop, x, y, paintx, painty, cheat.in_hack_mover() , true))
 		{			// Failed.
 		if (to_drop != obj)
 			{		// Watch for partial drop.
A better fix is possible, but I am too busy to address it right now.

This is untested, as I am unable to compile (even after reading all of the woefully out of date documents available, and searching forum), and do not have time to figure it out. Sorry.

Just thought I'd post this up in case anyone wants to run with it.

Re: Patch for Hackmover, to remove container size limit.

Posted: Fri Nov 21, 2008 5:23 pm
by Dominus
We have a collection of patches at http://sourceforge.net/tracker/?group_i ... tid=302335
Please add to this. Nothing gets forgotten there, here it will be swiftly off the first page and then forgotten...
This also (inadvertently) removes the recursion check when putting one container in another
This is really not safe and thus I'd advise strongly against this...

Re: Patch for Hackmover, to remove container size limit.

Posted: Fri Nov 21, 2008 7:14 pm
by zilpin
once the next release comes out, i'll make a better patch and post it on sf

Re: Patch for Hackmover, to remove container size limit.

Posted: Tue Nov 25, 2008 1:28 am
by Aerick
Not a proper diff, but these changes work without disabling the recursion check:

objs/contain.h:
#include "cheat.h"

int has_room(Game_object *obj) const
{ return cheat.in_hack_mover() || get_max_volume() get_volume() + volume_used 0 && objvol + volume_used > maxvol)
return false; // Doesn't fit.
}

I just found a bug while testing this out. It seems you can add items to locked chests as long as the chest is inside another container. ;)