Implemented Feature Request #719486: Campaign Stuff - New Trigger Actions

Fixed bug for incorrect key highlighted
This commit is contained in:
mr-russ 2003-04-16 22:52:05 +00:00
parent b195852c1e
commit 777eb5800f
4 changed files with 65 additions and 0 deletions

View file

@ -41,6 +41,9 @@
<P><LI>Future 1.19 Release<P>
<UL>
<LI>+++
<LI>Implemented Feature Request #719486: Campaign Stuff - New Trigger Actions
(from Russell Smith).
<LI>Fixed bug for incorrect key highlighted (from Russell Smith)
<LI>Can now stream .wav files (from Nehal Mistry).
<LI>Fixed Bug #712484: sinking ships are drawn under oil patches (from Russell Smith).
<LI>Fixed Bug #205078: Flyers should be drawn over fire (from Russell Smith).

View file

@ -48,6 +48,7 @@
<A HREF="#add-tip">add-tip</A>
<A HREF="#briefing">briefing</A>
<A HREF="#center-map">center-map</A>
<A HREF="#change-units-owner">change-units-owner</A>
<A HREF="#create-unit">create-unit</A>
<A HREF="#credits">credits</A>
<A HREF="#define-campaign">define-campaign</A>
@ -280,6 +281,39 @@ Center the current viewport at a certain location.
<H4>Not Used</H4>
<A NAME="change-units-owner"></A>
<H3>change-units-owner</H3>
<H4>Description</H4>
Changes the owner of a group of units from 1 player to another.
<H4>Syntax</H4>
<CODE>(change-units-owner '(x1 y1) '(x2 y2) oldplayer newplayer)</CODE>
<DL>
<DT>'(x1 y1)</DT>
<DD>Upper left location for tilebox to check for units within.</DD>
<DT>'(x2 y2)</DT>
<DD>Lower right location for tilebox to check for units within.</DD>
<DT>oldplayer</DT>
<DD>The player that currently owns the units</DD>
<DT>newplayer</DT>
<DD>The player that the units should now be owned by</DD>
<H4>Example</H4>
<PRE>
(change-units-owner '(0 0) '(10 10) 3 2)
</PRE>
<P>Changes the owner to player 2 for all units owned by player 3,
that are located in the area (0,0)-(10,10).
<H4>Not Used</H4>
<A NAME="create-unit"></A>
<H3>create-unit</H3>

View file

@ -129,6 +129,8 @@
<DD></DD>
<DT><A HREF="game.html#center-map">center-map</A></DT>
<DD></DD>
<DT><A HREF="game.html#change-units-owner">change-units-owner</A></DT>
<DD></DD
<DT><A HREF="research.html#check-dependency">check-dependency</A></DT>
<DD></DD>
<DT><A HREF="game.html#create-unit">create-unit</A></DT>

View file

@ -285,6 +285,31 @@ local SCM CclPlayer(SCM list)
return SCM_UNSPECIFIED;
}
/**
** Change Unit Owner
**
** @param pos1 top left tile
** @param pos2 bottom right tile
** @param old old player number
** @param new new player number
**/
local SCM CclChangeUnitsOwner(SCM pos1, SCM pos2, SCM old, SCM new)
{
Unit* table[UnitMax];
int n;
n = SelectUnits(gh_scm2int(gh_car(pos1)), gh_scm2int(gh_cadr(pos1)),
gh_scm2int(gh_car(pos2)), gh_scm2int(gh_cadr(pos2)), table);
while( n ) {
if(table[n-1]->Player->Player == gh_scm2int(old)) {
ChangeUnitOwner(table[n-1],&Players[gh_scm2int(old)],
&Players[gh_scm2int(new)]);
}
n--;
}
return SCM_UNSPECIFIED;
}
/**
** Get ThisPlayer.
**
@ -596,6 +621,7 @@ local SCM CclSetPlayerResource(SCM list)
global void PlayerCclRegister(void)
{
gh_new_procedureN("player",CclPlayer);
gh_new_procedure4_0("change-units-owner",CclChangeUnitsOwner);
gh_new_procedure0_0("get-this-player",CclGetThisPlayer);
gh_new_procedure1_0("set-this-player!",CclSetThisPlayer);