[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/map ccl_map.c
From: |
Russell Smith |
Subject: |
[Stratagus-CVS] stratagus/src/map ccl_map.c |
Date: |
Thu, 18 Sep 2003 21:19:28 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Russell Smith <address@hidden> 03/09/18 21:19:28
Modified files:
src/map : ccl_map.c
Log message:
Updated show-map-location to be more flexible
Patches:
Index: stratagus/src/map/ccl_map.c
diff -u stratagus/src/map/ccl_map.c:1.36 stratagus/src/map/ccl_map.c:1.37
--- stratagus/src/map/ccl_map.c:1.36 Mon Aug 25 07:21:18 2003
+++ stratagus/src/map/ccl_map.c Thu Sep 18 21:19:28 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_map.c,v 1.36 2003/08/25 11:21:18 mr-russ Exp $
+// $Id: ccl_map.c,v 1.37 2003/09/19 01:19:28 mr-russ Exp $
//@{
@@ -282,14 +282,17 @@
** @param y Y tile location.
** @param radius radius of view.
** @param cycle cycles show vision for.
+** @param unit name of unit to use for showing map
*/
-local SCM CclShowMapLocation(SCM x, SCM y, SCM radius, SCM cycle)
+local SCM CclShowMapLocation(SCM x, SCM y, SCM radius, SCM cycle, SCM unit)
{
Unit* target;
- //Put a revealer unit on the map, at this location
- //time to cycle, and radius to mark.
- // FIXME: Don't use UnitTypeByIdent during runtime.
- target = MakeUnit(UnitTypeByIdent("unit-revealer"), ThisPlayer);
+ char* unitname;
+ // Put a unit on map, use it's properties, except for
+ // what is listed below
+
+ unitname = gh_scm2newstr(unit,NULL);
+ target = MakeUnit(UnitTypeByIdent(unitname), ThisPlayer);
target->Orders[0].Action = UnitActionStill;
target->HP = 0;
target->X = gh_scm2int(x);
@@ -297,6 +300,7 @@
target->TTL=GameCycle+gh_scm2int(cycle);
target->CurrentSightRange=gh_scm2int(radius);
MapMarkUnitSight(target);
+ free(unitname);
return SCM_UNSPECIFIED;
}
/**
@@ -540,7 +544,7 @@
gh_new_procedureN("stratagus-map",CclStratagusMap);
gh_new_procedure0_0("reveal-map",CclRevealMap);
gh_new_procedure2_0("center-map",CclCenterMap);
- gh_new_procedure4_0("show-map-location",CclShowMapLocation);
+ gh_new_procedure5_0("show-map-location",CclShowMapLocation);
gh_new_procedure1_0("set-default-map!",CclSetDefaultMap);
gh_new_procedure1_0("set-fog-of-war!",CclSetFogOfWar);
- [Stratagus-CVS] stratagus/src/map ccl_map.c,
Russell Smith <=