temporarily ensure arg1 of /newmap is within a sane valid range (6-9)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6382 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+1
-1
@@ -799,7 +799,7 @@ docargument [V] [the volume] [default 255] [0];
|
||||
docremark [Will play map-specific sound so long as the player is within the radius. However, only up to the max uses allowed for N (specified in the mapsound command) will play, even if the player is within the radius of more N sounds than the max. By default (size 0), the sound is a point source. Its volume is maximal at the entity's location, and tapers off to 0 at the radius. If size is specified, the volume is maximal within the specified size, and only starts tapering once outside this distance. Radius is always defined as distance from the entity's location, so a size greater than or equal to the radius will just make a sound that is always max volume within the radius, and off outside.];
|
||||
docremark [A sound entity can be either ambient or non-ambient. Ambient sounds have no specific direction, they are 'just there'. Non-ambient sounds however appear to come from a specific direction (stereo panning). If S is set to 0, the sound is a single point and will therefore be non-ambient. However if S is greater than 0, the sound will be ambient as it covers a specified area instead of being a single point.];
|
||||
docident [newmap] [Creates a new map.];
|
||||
docargument [S] [the size of the new map] [6..12] [0];
|
||||
docargument [S] [the size of the new map] [6..9] [0];
|
||||
docremark [The new map has 2^S cubes. For S, 6 is small, 7 medium, 8 large.];
|
||||
docident [nextclosestent] [Choose another 'closest ent'.];
|
||||
docremark [Use this, when two entities are placed in exactly the same location.];
|
||||
|
||||
+1
-1
@@ -3252,7 +3252,7 @@ Output:
|
||||
<remark>The new map has 2^S cubes. For S, 6 is small, 7 medium, 8 large.</remark>
|
||||
</remarks>
|
||||
<arguments>
|
||||
<argument token="S" description="the size of the new map" valueNotes="6..12"/>
|
||||
<argument token="S" description="the size of the new map" valueNotes="6..9"/>
|
||||
</arguments>
|
||||
</command>
|
||||
|
||||
|
||||
@@ -500,10 +500,14 @@ bool empty_world(int factor, bool force) // main empty world creation routine
|
||||
void mapenlarge() { if(empty_world(-1, false)) addmsg(SV_NEWMAP, "ri", -1); }
|
||||
void mapshrink() { if(empty_world(-2, false)) addmsg(SV_NEWMAP, "ri", -2); }
|
||||
void newmap(int i) {
|
||||
if(empty_world(i, false))
|
||||
if(i < 6 || i > 9) conoutf("\f3Error: \f5newmap has a valid range of \f26-9"); // TODO: update this valid range when /newmap >9 stops crashing the client ;) - Bukz 2011apr27
|
||||
else
|
||||
{
|
||||
addmsg(SV_NEWMAP, "ri", max(i, 0));
|
||||
if(identexists("onNewMap")) execute("onNewMap");
|
||||
if(empty_world(i, false))
|
||||
{
|
||||
addmsg(SV_NEWMAP, "ri", max(i, 0));
|
||||
if(identexists("onNewMap")) execute("onNewMap");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user