modified processAutoStorage

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

DrKN
Developers
Developers
Posts: 79
Joined: 06 Oct 2010, 09:22
Noob?: No

modified processAutoStorage

#1 Post by DrKN »

I have added the new config setting - storageAuto_useItem
as some cash item like storage box and this will help
and also i have deleted sendStart and getStart as storageAuto and getAuto should be always happened when storage is opened
Also i have added to check $storage{opened} instead of the previous condition to gain advantage on using storage box but not closing it to get/put while OK is attacking or routing or something in that map.

I put in pastebin to have the perl syntax when viewing it :D


http://pastebin.com/0EQARPqe

**a mistake there: missing a closing bracket
** added delete $storage{opened}; into sub initMapChangeVars
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: modified processAutoStorage

#2 Post by EternalHarvest »

Stuff with storageAuto_useItem looks fine.

Code: Select all

$args->{done} = 1
This (and some other lines with $args->{done}) is deleted too?

Code: Select all

-	Plugins::callHook("AI_storage_done", \%hookArgs);
-	undef $args->{done} if ($hookArgs{return});
+	Plugins::callHook("AI_storage_done");
Why?

Also, "People can quickly inspect and understand your modifications and provide more intelligent feedback." if you post a diff.
DrKN
Developers
Developers
Posts: 79
Joined: 06 Oct 2010, 09:22
Noob?: No

Re: modified processAutoStorage

#3 Post by DrKN »

EternalHarvest wrote:Stuff with storageAuto_useItem looks fine.

Code: Select all

$args->{done} = 1
This (and some other lines with $args->{done}) is deleted too?

Code: Select all

-	Plugins::callHook("AI_storage_done", \%hookArgs);
-	undef $args->{done} if ($hookArgs{return});
+	Plugins::callHook("AI_storage_done");
Why?

Also, "People can quickly inspect and understand your modifications and provide more intelligent feedback." if you post a diff.
Plugins::callHook("AI_storage_done", \%hookArgs); is deleted because hookArgs is blank when calling the hook so i changed it into no argv
$args->{done} seems no much meaning here? or i have misunderstanding the code...?
theres a issue rite now... after using the storage box it will keep standing if there is a monster attacking YOU

i want to post a diff but how should i do..?
posting the code in forum or... somewhere able to do a diff upload?
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: modified processAutoStorage

#4 Post by EternalHarvest »

DrKN wrote:Plugins::callHook("AI_storage_done", \%hookArgs); is deleted because hookArgs is blank when calling the hook so i changed it into no argv

Code: Select all

# plugins can hook here and decide to keep storage open longer
Hook handler can write to hookArgs and this is checked right in the next line.
$args->{done} seems no much meaning here? or i have misunderstanding the code...?
It seems to be the flag indicating whether storaging is finished or not.
i want to post a diff but how should i do..?
posting the code in forum or... somewhere able to do a diff upload?
Post in forum post or pastebin, it's all text anyway.