Turn OFF AI::Homunculus when char don't have Homunculus

This section is created for developers and non-developers who think that he/she has a good (and realistic) idea that might contribute to the OpenKore community.

Moderator: Moderators

Message
Author
Chontrad
Human
Human
Posts: 30
Joined: 23 Apr 2008, 10:11
Noob?: No
Location: Indonesia TANAH AIRKU
Contact:

Turn OFF AI::Homunculus when char don't have Homunculus

#1 Post by Chontrad »

Let's reduce PC usage by making this little fix.

<Line 591, File: SRC\functions.pl>
# Process AI
if ($net->getState() == Network::IN_GAME && timeOut($timeout{ai}) && $net->serverAlive()) {
Misc::checkValidity("AI (pre)");
Benchmark::begin("ai") if DEBUG;
AI::CoreLogic::iterate();
Benchmark::end("ai") if DEBUG;
if ($char->{homunculus}) {
Benchmark::begin("ai_homunculus") if DEBUG;
AI::Homunculus::iterate();
Benchmark::end("ai_homunculus") if DEBUG;
}
Misc::checkValidity("AI");
return if $quit;
}

Piece of cake... Teehe! ;)

h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House
Contact:

Re: Turn OFF AI::Homunculus when char don't have Homunculus

#2 Post by h4rry84 »

to note that it's already in IF DEBUG state, it's for debugging :?

hakore
Super Moderators
Super Moderators
Posts: 200
Joined: 16 May 2008, 08:28
Noob?: No
Contact:

Re: Turn OFF AI::Homunculus when char don't have Homunculus

#3 Post by hakore »

You must have missed this. See:
AI\Homunculus.pm
AI::Homunculus::iterate()

sub iterate {
return if (!$char->{homunculus});

And what h4rry84 said.
Whatever...

Chontrad
Human
Human
Posts: 30
Joined: 23 Apr 2008, 10:11
Noob?: No
Location: Indonesia TANAH AIRKU
Contact:

Re: Turn OFF AI::Homunculus when char don't have Homunculus

#4 Post by Chontrad »

OMG! I missed that. Sry then.

Post Reply