$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/action/action_move.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "video.h"
#include "unittype.h"
#include "animation.h"
#include "player.h"
#include "unit.h"
#include "tileset.h"
#include "map.h"
#include "actions.h"
#include "pathfinder.h"
#include "sound.h"
#include "interface.h"
#include "ai.h"

Functions

action_move.cpp - The move action.
int DoActionMove (CUnit &unit)
 Generic move action.
void HandleActionMove (CUnit &unit)
 Handle command move.

Function Documentation

int DoActionMove ( CUnit unit  ) 

Generic move action.

Unit moves! Generic function called from other actions.

Parameters:
unit Pointer to unit.
Returns:
>0 remaining path length, 0 wait for path, -1 reached goal, -2 can't reach the goal.

void HandleActionMove ( CUnit unit  ) 

Handle command move.

Unit move action:

Move to a place or to a unit (can move). Tries 10x to reach the target, note this are the complete tries. If the target entered another unit, move to it's position. If the target unit is destroyed, continue to move to it's last position.

Parameters:
unit Pointer to unit.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.