Author Topic: Is Unit Unit1 Doing Something Or Not?  (Read 1414 times)

Offline Flashy

  • Sr. Member
  • ****
  • Posts: 391
Is Unit Unit1 Doing Something Or Not?
« on: May 25, 2010, 11:45:14 AM »
How can i check if a certain unit just sits around or is moving or is busy with something else? Maybe
Code: [Select]
if(unit1.GetBusy() == 0)
{
//Unit is doing nothing
}
else
{
//Unit is Moving or it does something else
}
(Just a guess)
« Last Edit: May 25, 2010, 11:47:24 AM by Flashy »
Praise the mighty light towers!!!

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Is Unit Unit1 Doing Something Or Not?
« Reply #1 on: May 25, 2010, 12:26:18 PM »
Well, if you have commands.h, which comes with IUnit.h, you will have a list of all currently known (probably all) unit/building commands.
Unit.GetBusy() will return one of those commands, and you can write ifs or switches to use the info retrieved.
"Nothing from nowhere, I'm no one at all"

Offline Flashy

  • Sr. Member
  • ****
  • Posts: 391
Is Unit Unit1 Doing Something Or Not?
« Reply #2 on: May 25, 2010, 01:06:59 PM »
Thanks. That was the last part of my evacuation transport code. Now version 0.10 is finally ready.
Praise the mighty light towers!!!