Patch for Hackmover, to remove container size limit.

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
zilpin
Posts: 2
Joined: Thu May 14, 2020 1:34 pm

Patch for Hackmover, to remove container size limit.

Post 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.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

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

Post 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...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
zilpin
Posts: 2
Joined: Thu May 14, 2020 1:34 pm

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

Post by zilpin »

once the next release comes out, i'll make a better patch and post it on sf
Aerick
Posts: 22
Joined: Thu May 14, 2020 1:34 pm

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

Post 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. ;)
Locked