diff --git a/config/mdarray.cfg b/config/mdarray.cfg index 5741084b..ea38fc0d 100644 --- a/config/mdarray.cfg +++ b/config/mdarray.cfg @@ -30,6 +30,15 @@ getQuotePosition = [ ] ] +removeLeadingWhitespace = [ + newstr = ""; gotchar = 0 + loop re (strlen $arg1) [ + if (&& (! $gotchar) (! (testchar (substr $arg1 $re 1) 7))) [ gotchar = 1 ] + if $gotchar [ newstr = (concatword $newstr (substr $arg1 $re 1)) ] + ] + result $newstr +] + reverseString = [ oldstr = $arg1 newstr = "" @@ -162,7 +171,7 @@ MDArray_Delete_Subarray = [ ] ] ] - delstr = (substr $orig_array $target_pos (- $gotclose $target_pos)) + delstr = (substr $orig_array $target_pos (- (+ $gotclose 1) $target_pos)) $arg1 = (strreplace $orig_array $delstr "") result (getalias $arg1) ] @@ -196,5 +205,26 @@ MDArray_Modify_Subarray = [ ] ] +MDArray_Add_To_Subarray = [ + mdarray = (getalias $arg1) + target_sub = (findlist $mdarray $arg2) + to_add = $arg3 + + if (!= $target_sub -1) [ + subarray = (MDArray_Get $arg1 $arg2 -1) + if (islists $to_add) [ + if (islists $subarray) [ newarray = (concat $subarray $to_add) ] [ + newarray = (concat (addpunct $subarray) $to_add) + ] + ] [ + if (islists $subarray) [ newarray = (concat $subarray (addpunct $to_add)) ] [ + newarray = (concat (addpunct $subarray) (addpunct $to_add)) + ] + ] + MDArray_Delete_Subarray $arg1 $arg2 + MDArray_New_Subarray $arg1 $arg2 (removeLeadingWhitespace $newarray) + ] +] + // some of these aliases can cause issues if they get stored in saved.cfg (missing bracket errors/etc.) addListOnQuit "bool MDArray_New_Subarray MDArray_Get_Bracket_Positions MDArray_Get reverseString MDArray_Get_All_Opening_Bracket_Positions MDArray_Get_Subarray_Count MDArray_Get_All_Subarray_Names extractSubarrayName MDArray_Search MDArray_Delete_Subarray MDArray_Modify_Subarray original_subarray target_elem new_elem new_subarray j next_elem islists hasQuotePair got_open_quote got_close_quote r i d mdarray subarray firstchar lastchar oldstr newstr subarray_names subarray_name tmpchar token subarrays search_results curarray orig_array target_subarray target_pos gotclose delstr h next_char" \ No newline at end of file diff --git a/config/survival.cfg b/config/survival.cfg index e0b12369..65148121 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -144,8 +144,8 @@ const changegamma [ if (> $curgamma $targetgamma) [ loopss = (- $curgamma $targetgamma) ] [ loopss = (- $targetgamma $curgamma) ] - loop i $loopss [ - sleep (* $i $incrementss) [ + loop t $loopss [ + sleep (* $t $incrementss) [ gamma ((at "+ -" (> $curgamma $targetgamma)) $gamma 1) ] ] diff --git a/docs/reference.xml b/docs/reference.xml index ad210f6e..06859052 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -1286,6 +1286,31 @@ echo foo + + + + + + + + + + + + Adds a string to an existing subarray in a cubescript multidimensional array. + + + + Output: "this is part of list1" "and so is this" + + + + + + + + + @@ -1311,6 +1336,7 @@ echo foo + @@ -1336,6 +1362,7 @@ echo foo + @@ -1352,6 +1379,7 @@ echo foo + @@ -1367,6 +1395,7 @@ echo foo + @@ -1387,6 +1416,7 @@ echo foo + @@ -1414,6 +1444,7 @@ echo foo + diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 3ebe7f5c..5ca24412 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -777,7 +777,8 @@ inline const char * spawn_message() else return "3You must be on the correct map to spawn. Type /getmap to download it."; } else if (m_coop) return "3Type /getmap or send a map and vote for it to start co-op edit."; - else return "4Awaiting permission to spawn. \f2DON'T PANIC!"; + else if (multiplayer(false)) return "4Awaiting permission to spawn. \f2DON'T PANIC!"; + else return ""; // theres no waiting for permission in sp // Despite its many glaring (and occasionally fatal) inaccuracies, AssaultCube itself has outsold the // Encyclopedia Galactica because it is slightly cheaper, and because it has the words "Don't Panic" // in large, friendly letters.