refactor into function calls to avoid stack overflow
This commit is contained in:
parent
7cf2a44404
commit
ea0324e716
1 changed files with 41 additions and 37 deletions
|
@ -1757,18 +1757,7 @@
|
||||||
<STRING> ()setNamedEntityProp($BCVar, "param2", ""); // </STRING>
|
<STRING> ()setNamedEntityProp($BCVar, "param2", ""); // </STRING>
|
||||||
<STRING>}</STRING>
|
<STRING>}</STRING>
|
||||||
<STRING></STRING>
|
<STRING></STRING>
|
||||||
<STRING>// $botEid, $playerEid</STRING>
|
<STRING>NoOneIsFishing(){</STRING>
|
||||||
<STRING>BCaddPlayer(){</STRING>
|
|
||||||
<STRING> BCP = 0;</STRING>
|
|
||||||
<STRING>$ttt = "v0 = " + v0;</STRING>
|
|
||||||
<STRING> ()phraseEndSystemMsg(0, "shout", $ttt);</STRING>
|
|
||||||
<STRING>$ttt = "boteid2 = " + $botEid;</STRING>
|
|
||||||
<STRING> ()phraseEndSystemMsg(0, "shout", $ttt);</STRING>
|
|
||||||
<STRING>$ttt = "botFamily2 = " + $botFamily;</STRING>
|
|
||||||
<STRING> ()phraseEndSystemMsg(0, "shout", $ttt);</STRING>
|
|
||||||
<STRING></STRING>
|
|
||||||
<STRING> switch(v0){</STRING>
|
|
||||||
<STRING> case 0:{ // No one is fishing</STRING>
|
|
||||||
<STRING> v0 = 1; // P1 is now fishing</STRING>
|
<STRING> v0 = 1; // P1 is now fishing</STRING>
|
||||||
<STRING> v1 = 0; // etat initial < 1000, fishing >= 1000</STRING>
|
<STRING> v1 = 0; // etat initial < 1000, fishing >= 1000</STRING>
|
||||||
<STRING>$ttt = "boteid3 = " + $botEid;</STRING>
|
<STRING>$ttt = "boteid3 = " + $botEid;</STRING>
|
||||||
|
@ -1778,8 +1767,9 @@
|
||||||
<STRING> ()setNamedEntityProp($botEid, "state", $botFamily); // botFamily requirement</STRING>
|
<STRING> ()setNamedEntityProp($botEid, "state", $botFamily); // botFamily requirement</STRING>
|
||||||
<STRING> BCP = 1;</STRING>
|
<STRING> BCP = 1;</STRING>
|
||||||
<STRING> BuildPlayerSlot();</STRING>
|
<STRING> BuildPlayerSlot();</STRING>
|
||||||
<STRING> }</STRING>
|
<STRING>}</STRING>
|
||||||
<STRING> case 1:{ // P1 is fishing</STRING>
|
<STRING></STRING>
|
||||||
|
<STRING>P1AlreadyFishing(){</STRING>
|
||||||
<STRING> $BCVar = $botEid + "_P11";</STRING>
|
<STRING> $BCVar = $botEid + "_P11";</STRING>
|
||||||
<STRING> ($BCP)getNamedEntityProp($BCVar, "state");</STRING>
|
<STRING> ($BCP)getNamedEntityProp($BCVar, "state");</STRING>
|
||||||
<STRING> if($BCP != $playerEid){</STRING>
|
<STRING> if($BCP != $playerEid){</STRING>
|
||||||
|
@ -1788,8 +1778,9 @@
|
||||||
<STRING> v2 = 0; // etat initial < 1000, fishing >= 1000</STRING>
|
<STRING> v2 = 0; // etat initial < 1000, fishing >= 1000</STRING>
|
||||||
<STRING> BuildPlayerSlot();</STRING>
|
<STRING> BuildPlayerSlot();</STRING>
|
||||||
<STRING> }</STRING>
|
<STRING> }</STRING>
|
||||||
<STRING> }</STRING>
|
<STRING>}</STRING>
|
||||||
<STRING> case 2:{ // P2 is fishing</STRING>
|
<STRING></STRING>
|
||||||
|
<STRING>P2AlreadyFishing(){</STRING>
|
||||||
<STRING> $BCVar = $botEid + "_P21";</STRING>
|
<STRING> $BCVar = $botEid + "_P21";</STRING>
|
||||||
<STRING> ($BCP)getNamedEntityProp($BCVar, "state");</STRING>
|
<STRING> ($BCP)getNamedEntityProp($BCVar, "state");</STRING>
|
||||||
<STRING> if($BCP != $playerEid){</STRING>
|
<STRING> if($BCP != $playerEid){</STRING>
|
||||||
|
@ -1800,6 +1791,19 @@
|
||||||
<STRING> BuildPlayerSlot();</STRING>
|
<STRING> BuildPlayerSlot();</STRING>
|
||||||
<STRING> ()phraseEndSystemMsg(0, "shout", "2 => 1 => apres");</STRING>
|
<STRING> ()phraseEndSystemMsg(0, "shout", "2 => 1 => apres");</STRING>
|
||||||
<STRING> }</STRING>
|
<STRING> }</STRING>
|
||||||
|
<STRING>}</STRING>
|
||||||
|
<STRING></STRING>
|
||||||
|
<STRING>// $botEid, $playerEid</STRING>
|
||||||
|
<STRING>BCaddPlayer(){</STRING>
|
||||||
|
<STRING> BCP = 0;</STRING>
|
||||||
|
<STRING> switch(v0){ // No one is fishing</STRING>
|
||||||
|
<STRING> NoOneIsFishing()</STRING>
|
||||||
|
<STRING> }</STRING>
|
||||||
|
<STRING> case 1:{ // P1 is already fishing</STRING>
|
||||||
|
<STRING> P1AlreadyFishing();</STRING>
|
||||||
|
<STRING> }</STRING>
|
||||||
|
<STRING> case 2:{ // P2 is already fishing</STRING>
|
||||||
|
<STRING> P2AlreadyFishing();</STRING>
|
||||||
<STRING> }</STRING>
|
<STRING> }</STRING>
|
||||||
<STRING> case 3: // P1 and P2 are already fishing</STRING>
|
<STRING> case 3: // P1 and P2 are already fishing</STRING>
|
||||||
<STRING> ()phraseEndSystemMsg(0, "shout", "TOO_MANY_PLAYERS_ARE_FISHING");</STRING>
|
<STRING> ()phraseEndSystemMsg(0, "shout", "TOO_MANY_PLAYERS_ARE_FISHING");</STRING>
|
||||||
|
|
Loading…
Reference in a new issue