diff options
Diffstat (limited to 'Doc/doxygen/html/_radio_handler_8cpp_source.html')
-rw-r--r-- | Doc/doxygen/html/_radio_handler_8cpp_source.html | 675 |
1 files changed, 675 insertions, 0 deletions
diff --git a/Doc/doxygen/html/_radio_handler_8cpp_source.html b/Doc/doxygen/html/_radio_handler_8cpp_source.html new file mode 100644 index 0000000..fc16cfe --- /dev/null +++ b/Doc/doxygen/html/_radio_handler_8cpp_source.html @@ -0,0 +1,675 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<meta http-equiv="X-UA-Compatible" content="IE=9"/> +<title>Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/RadioHandler.cpp Source File</title> +<link href="tabs.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="jquery.js"></script> +<script type="text/javascript" src="dynsections.js"></script> +<link href="navtree.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="resize.js"></script> +<script type="text/javascript" src="navtree.js"></script> +<script type="text/javascript"> + $(document).ready(initResizable); +</script> +<link href="search/search.css" rel="stylesheet" type="text/css"/> +<script type="text/javascript" src="search/search.js"></script> +<script type="text/javascript"> + $(document).ready(function() { searchBox.OnSelectItem(0); }); +</script> +<link href="doxygen.css" rel="stylesheet" type="text/css" /> +</head> +<body> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> +<div id="titlearea"> +<table cellspacing="0" cellpadding="0"> + <tbody> + <tr style="height: 56px;"> + <td style="padding-left: 0.5em;"> + <div id="projectname">Starshatter_Open + </div> + <div id="projectbrief">Open source Starshatter engine</div> + </td> + </tr> + </tbody> +</table> +</div> +<!-- end header part --> +<!-- Generated by Doxygen 1.8.1 --> +<script type="text/javascript"> +var searchBox = new SearchBox("searchBox", "search",false,'Search'); +</script> + <div id="navrow1" class="tabs"> + <ul class="tablist"> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + <li> + <div id="MSearchBox" class="MSearchBoxInactive"> + <span class="left"> + <img id="MSearchSelect" src="search/mag_sel.png" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + alt=""/> + <input type="text" id="MSearchField" value="Search" accesskey="S" + onfocus="searchBox.OnSearchFieldFocus(true)" + onblur="searchBox.OnSearchFieldFocus(false)" + onkeyup="searchBox.OnSearchFieldChange(event)"/> + </span><span class="right"> + <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> + </span> + </div> + </li> + </ul> + </div> + <div id="navrow2" class="tabs2"> + <ul class="tablist"> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div><!-- top --> +<div id="side-nav" class="ui-resizable side-nav-resizable"> + <div id="nav-tree"> + <div id="nav-tree-contents"> + </div> + </div> + <div id="splitbar" style="-moz-user-select:none;" + class="ui-resizable-handle"> + </div> +</div> +<script type="text/javascript"> +$(document).ready(function(){initNavTree('_radio_handler_8cpp.html','');}); +</script> +<div id="doc-content"> +<!-- window showing the filter options --> +<div id="MSearchSelectWindow" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + onkeydown="return searchBox.OnSearchSelectKey(event)"> +<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Macros</a></div> + +<!-- iframe showing the search results (closed by default) --> +<div id="MSearchResultsWindow"> +<iframe src="javascript:void(0)" frameborder="0" + name="MSearchResults" id="MSearchResults"> +</iframe> +</div> + +<div class="header"> + <div class="headertitle"> +<div class="title">RadioHandler.cpp</div> </div> +</div><!--header--> +<div class="contents"> +<a href="_radio_handler_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/* Project Starshatter 5.0</span></div> +<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> Destroyer Studios LLC</span></div> +<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> Copyright © 1997-2007. All Rights Reserved.</span></div> +<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"></span></div> +<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> SUBSYSTEM: Stars.exe</span></div> +<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> FILE: RadioHandler.cpp</span></div> +<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> AUTHOR: John DiCamillo</span></div> +<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"></span></div> +<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div> +<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> OVERVIEW</span></div> +<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> ========</span></div> +<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> Radio message handler class implementation</span></div> +<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">*/</span></div> +<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div> +<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include "<a class="code" href="_mem_debug_8h.html">MemDebug.h</a>"</span></div> +<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="_radio_handler_8h.html">RadioHandler.h</a>"</span></div> +<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="_radio_message_8h.html">RadioMessage.h</a>"</span></div> +<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_radio_traffic_8h.html">RadioTraffic.h</a>"</span></div> +<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_instruction_8h.html">Instruction.h</a>"</span></div> +<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div> +<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="_contact_8h.html">Contact.h</a>"</span></div> +<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "<a class="code" href="_element_8h.html">Element.h</a>"</span></div> +<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="_mission_8h.html">Mission.h</a>"</span></div> +<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="_ship_8h.html">Ship.h</a>"</span></div> +<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="_ship_design_8h.html">ShipDesign.h</a>"</span></div> +<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="_sim_8h.html">Sim.h</a>"</span></div> +<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="_star_system_8h.html">StarSystem.h</a>"</span></div> +<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="_power_8h.html">Power.h</a>"</span></div> +<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="_drive_8h.html">Drive.h</a>"</span></div> +<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "<a class="code" href="_shield_8h.html">Shield.h</a>"</span></div> +<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="_hangar_8h.html">Hangar.h</a>"</span></div> +<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "<a class="code" href="_flight_deck_8h.html">FlightDeck.h</a>"</span></div> +<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include "<a class="code" href="_weapon_group_8h.html">WeaponGroup.h</a>"</span></div> +<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "<a class="code" href="_steer_a_i_8h.html">SteerAI.h</a>"</span></div> +<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div> +<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "<a class="code" href="_text_8h.html">Text.h</a>"</span></div> +<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include "<a class="code" href="_game_8h.html">Game.h</a>"</span></div> +<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div> +<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> +<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div> +<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="class_radio_handler.html#a6796be5d9c38e629a13161e10d100b3c"> 41</a></span> <a class="code" href="class_radio_handler.html#a6796be5d9c38e629a13161e10d100b3c">RadioHandler::RadioHandler</a>()</div> +<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> { }</div> +<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div> +<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="class_radio_handler.html#af270ae9f96add1f3db34ce9d1bb5007c"> 44</a></span> <a class="code" href="class_radio_handler.html#af270ae9f96add1f3db34ce9d1bb5007c">RadioHandler::~RadioHandler</a>()</div> +<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> { }</div> +<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div> +<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> +<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div> +<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="class_radio_handler.html#ad839256c597e6d0a9724587a0dabd488"> 50</a></span> <a class="code" href="class_radio_handler.html#ad839256c597e6d0a9724587a0dabd488">RadioHandler::ProcessMessage</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* s)</div> +<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> {</div> +<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">if</span> (!s || !msg || !msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>())</div> +<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div> +<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">if</span> (s-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() >= <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824a50a9fd6ea07163add869ecc7886b4f84">Ship::FARCASTER</a> && s-><a class="code" href="class_ship.html#a7001f58e1ca4b79ff8a1a176384d8a4b">Class</a>() <= <a class="code" href="class_ship.html#a71fbded084bb90d16f77d87b7eae5824a39baaf1e9293b552e077b7ebc68e8974">Ship::C3I</a>)</div> +<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div> +<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>()-><a class="code" href="class_ship.html#acf065374e136b9255857d49b352351af">IsRogue</a>()) {</div> +<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <a class="code" href="class_ship.html">Ship</a>* sender = (<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>(); <span class="comment">// cast-away const</span></div> +<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* nak = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(sender, s, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ae5caab37804239c520c5754d7419848b">RadioMessage::NACK</a>);</div> +<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(nak);</div> +<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  }</div> +<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div> +<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordtype">bool</span> respond = (s != msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>());</div> +<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div> +<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="comment">// SPECIAL CASE:</span></div> +<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">// skip navpoint must be processed by elem leader,</span></div> +<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">// even if the elem leader sent the message:</span></div> +<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div> +<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ad4d48873938b526293335053afca2128">RadioMessage::SKIP_NAVPOINT</a> && !respond)</div> +<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="class_radio_handler.html#a25a208c606b175e13dda1a3aeee00471">ProcessMessageAction</a>(msg, s);</div> +<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div> +<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">if</span> (!<a class="code" href="class_radio_handler.html#a8674781aff497da738a14ac70853b65d">ProcessMessageOrders</a>(msg, s))</div> +<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  respond = respond && <a class="code" href="class_radio_handler.html#a25a208c606b175e13dda1a3aeee00471">ProcessMessageAction</a>(msg, s);</div> +<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div> +<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">return</span> respond;</div> +<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> }</div> +<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div> +<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> +<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div> +<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="class_radio_handler.html#acefeffc0685685c6b2d3891c2a78c4aa"> 83</a></span> <a class="code" href="class_radio_handler.html#acefeffc0685685c6b2d3891c2a78c4aa">RadioHandler::IsOrder</a>(<span class="keywordtype">int</span> action)</div> +<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> {</div> +<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">bool</span> result = <span class="keyword">false</span>;</div> +<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div> +<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">switch</span> (action) {</div> +<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">default</span>:</div> +<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7c566bca597f923aa05f08ff02ca8049">RadioMessage::NONE</a>:</div> +<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a1bfb47ab140e088c91e95e34d847efc0">RadioMessage::ACK</a>:</div> +<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ae5caab37804239c520c5754d7419848b">RadioMessage::NACK</a>: result = <span class="keyword">false</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div> +<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="comment">// target mgt:</span></div> +<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aebb3dbda4bef696b3fa43756b42cbe07">RadioMessage::ATTACK</a>:</div> +<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a94f437f89bd938e97777b1df27925871">RadioMessage::ESCORT</a>:</div> +<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af76cdb7c21fa629ec66d4939f2afc8c0">RadioMessage::BRACKET</a>:</div> +<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ae7636e1dee5afbd297214580d4c4891b">RadioMessage::IDENTIFY</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div> +<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">// combat mgt:</span></div> +<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af7433b1fd306d597871903a612ded3b0">RadioMessage::COVER_ME</a>:</div> +<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25acba4b2a9d4835417af26c9a44eafeb0a">RadioMessage::WEP_HOLD</a>:</div> +<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a94f470c040ff9ea3cda583698b0f23a5">RadioMessage::FORM_UP</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div> +<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ac30edb406167e3ddcd52572b2903dc2a">RadioMessage::WEP_FREE</a>:</div> +<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a1d5a73cd6890467cc4aa70f6701abad8">RadioMessage::SAY_POSITION</a>:</div> +<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a0b246ae995e4e11fcd8530e8dc639d39">RadioMessage::LAUNCH_PROBE</a>: result = <span class="keyword">false</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> </div> +<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="comment">// formation mgt:</span></div> +<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aff2c7dfe629618df4225cbcf19ee54ae">RadioMessage::GO_DIAMOND</a>:</div> +<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a377357e9ea0e37ba2a54b0690d92ba7c">RadioMessage::GO_SPREAD</a>:</div> +<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a56c1bc4178dae246b13502cdb462b29b">RadioMessage::GO_BOX</a>:</div> +<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25afe6da826df078b602b5b10829327bb3d">RadioMessage::GO_TRAIL</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> </div> +<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">// mission mgt:</span></div> +<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ad1acb534c24126048c3abcd4cf331d84">RadioMessage::MOVE_PATROL</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ad4d48873938b526293335053afca2128">RadioMessage::SKIP_NAVPOINT</a>: result = <span class="keyword">false</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7cdfe8d3ec2532c654c4979610700da8">RadioMessage::RESUME_MISSION</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div> +<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a3f18533cfe09d992ae57374ab762f946">RadioMessage::RTB</a>:</div> +<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af331f349de85c6c723cd1ff49d9097ba">RadioMessage::DOCK_WITH</a>:</div> +<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af8047234742ddbba04628ac968a51a27">RadioMessage::QUANTUM_TO</a>:</div> +<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a71bdde6b4c48cc74aaaf93d7e14a9460">RadioMessage::FARCAST_TO</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div> +<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="comment">// sensor mgt:</span></div> +<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ac305b82af6cfbff0d4791c568beac6c3">RadioMessage::GO_EMCON1</a>:</div> +<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7fabf22959ecdd8ce60e8be8cdd93993">RadioMessage::GO_EMCON2</a>:</div> +<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25abccd2f8bcf2fb7a0a68ecf51f192edc7">RadioMessage::GO_EMCON3</a>: result = <span class="keyword">true</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> </div> +<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="comment">// support:</span></div> +<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a86b4436086be6c279a0fdbf90166f895">RadioMessage::REQUEST_PICTURE</a>:</div> +<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25afe75b66b3ea721d3defe3358f7b14854">RadioMessage::REQUEST_SUPPORT</a>:</div> +<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af31d05a9ff89a5248fd1bfbd40799471">RadioMessage::PICTURE</a>: result = <span class="keyword">false</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div> +<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="comment">// traffic control:</span></div> +<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a83d3c0822a1855980fa75ad6ea665fa7">RadioMessage::CALL_INBOUND</a>:</div> +<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a05b6116476395e39282e6f08771aeaec">RadioMessage::CALL_APPROACH</a>:</div> +<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7acdd9d35937ec94df7ccdcb27a6a5ea">RadioMessage::CALL_CLEARANCE</a>:</div> +<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a5879c1b3e16f7f428ac07eb3bbf71187">RadioMessage::CALL_FINALS</a>:</div> +<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a2f9afb72672ea98f4da53c6e1334f615">RadioMessage::CALL_WAVE_OFF</a>: result = <span class="keyword">false</span>; <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  }</div> +<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div> +<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">return</span> result;</div> +<div class="line"><a name="l00143"></a><span class="lineno"> 143</span> }</div> +<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div> +<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> +<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div> +<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00148"></a><span class="lineno"><a class="code" href="class_radio_handler.html#a8674781aff497da738a14ac70853b65d"> 148</a></span> <a class="code" href="class_radio_handler.html#a8674781aff497da738a14ac70853b65d">RadioHandler::ProcessMessageOrders</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> {</div> +<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="class_instruction.html">Instruction</a>* instruction = ship-><a class="code" href="class_ship.html#ad4b1ede340f2a31d17a82a266c7f3f5b">GetRadioOrders</a>();</div> +<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordtype">int</span> action = 0;</div> +<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div> +<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">if</span> (msg && msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7cdfe8d3ec2532c654c4979610700da8">RadioMessage::RESUME_MISSION</a>) {</div> +<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  instruction-><a class="code" href="class_instruction.html#ada0518fbd58c13d32450afa321dc812d">SetAction</a>(<a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7c566bca597f923aa05f08ff02ca8049">RadioMessage::NONE</a>);</div> +<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  instruction-><a class="code" href="class_instruction.html#aebb3cb9d4276ebae82d94b7c9a56d60a">SetFormation</a>(-1);</div> +<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  instruction-><a class="code" href="class_instruction.html#acc929a6ecc5fad5f9090243e54738725">SetWeaponsFree</a>(<span class="keyword">true</span>);</div> +<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> (instruction-><a class="code" href="class_instruction.html#a5fe6667a4207dc635a4320b5d7bbaa8b">GetTarget</a>()) {</div> +<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  instruction-><a class="code" href="class_instruction.html#a8677ceb0b7e6e06a0b870a1e98e33a5f">ClearTarget</a>();</div> +<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  ship-><a class="code" href="class_ship.html#a32acf68f5ac07882e170cf08718fe031">DropTarget</a>();</div> +<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  }</div> +<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div> +<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div> +<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> </div> +<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">if</span> (msg && <a class="code" href="class_radio_handler.html#acefeffc0685685c6b2d3891c2a78c4aa">IsOrder</a>(msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>())) {</div> +<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keywordtype">int</span> posture_only = <span class="keyword">false</span>;</div> +<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div> +<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  action = msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>();</div> +<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div> +<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">if</span> (action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a94f470c040ff9ea3cda583698b0f23a5">RadioMessage::FORM_UP</a>)</div> +<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  action = <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25acba4b2a9d4835417af26c9a44eafeb0a">RadioMessage::WEP_HOLD</a>;</div> +<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div> +<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="comment">// target orders => drop current target:</span></div> +<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">if</span> (action >= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aebb3dbda4bef696b3fa43756b42cbe07">RadioMessage::ATTACK</a> &&</div> +<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  action <= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af7433b1fd306d597871903a612ded3b0">RadioMessage::COVER_ME</a> ||</div> +<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25acba4b2a9d4835417af26c9a44eafeb0a">RadioMessage::WEP_HOLD</a> ||</div> +<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  action >= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af331f349de85c6c723cd1ff49d9097ba">RadioMessage::DOCK_WITH</a> &&</div> +<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  action <= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a71bdde6b4c48cc74aaaf93d7e14a9460">RadioMessage::FARCAST_TO</a>) {</div> +<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div> +<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">if</span> (ship != msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>())</div> +<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  ship-><a class="code" href="class_ship.html#a32acf68f5ac07882e170cf08718fe031">DropTarget</a>();</div> +<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div> +<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <a class="code" href="class_director.html">Director</a>* dir = ship-><a class="code" href="class_physical.html#afb266107493cf3b901d794903d6f1077">GetDirector</a>();</div> +<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">if</span> (dir && dir-><a class="code" href="class_director.html#a3b5abe29979a016ef78c40ebf82ace4a">Type</a>() >= <a class="code" href="class_steer_a_i.html#ab5f1818dcf2918bd33744c178eae1ba2aa3f292fcd0565714850051a709863086">SteerAI::SEEKER</a> && dir-><a class="code" href="class_director.html#a3b5abe29979a016ef78c40ebf82ace4a">Type</a>() <= <a class="code" href="class_steer_a_i.html#ab5f1818dcf2918bd33744c178eae1ba2abf1a60535ad0067d16d264dc7836b85f">SteerAI::GROUND</a>) {</div> +<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <a class="code" href="class_steer_a_i.html">SteerAI</a>* ai = (<a class="code" href="class_steer_a_i.html">SteerAI</a>*) dir;</div> +<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  ai-><a class="code" href="class_steer_a_i.html#a03059ec411bde689e6fcf911fe563619">SetTarget</a>(0);</div> +<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  }</div> +<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div> +<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="comment">// farcast and quantum jump radio messages:</span></div> +<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordflow">if</span> (action >= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af8047234742ddbba04628ac968a51a27">RadioMessage::QUANTUM_TO</a>) {</div> +<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <a class="code" href="class_sim.html">Sim</a>* sim = <a class="code" href="class_sim.html#a14b48a472bca6d04230c789fc4beab4c">Sim::GetSim</a>();</div> +<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  </div> +<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">if</span> (sim) {</div> +<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="class_sim_region.html">SimRegion</a>* rgn = sim-><a class="code" href="class_sim.html#a321b8fc1c61e63f66138adf5bd16cba5">FindRegion</a>(msg-><a class="code" href="class_radio_message.html#a8fa1adbe0ef1d4ee4f9a8ea611fc47e8">Info</a>());</div> +<div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div> +<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keywordflow">if</span> (rgn) {</div> +<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  instruction-><a class="code" href="class_instruction.html#ada0518fbd58c13d32450afa321dc812d">SetAction</a>(action);</div> +<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  instruction-><a class="code" href="class_instruction.html#a1ddf1c25861d2319955e5b737f387a56">SetLocation</a>(<a class="code" href="struct_point.html">Point</a>(0,0,0));</div> +<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  instruction-><a class="code" href="class_instruction.html#a193a3e15384c07deb39997f59d946d54">SetRegion</a>(rgn);</div> +<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  instruction-><a class="code" href="class_instruction.html#a0e6ed7e60a78c56e0d7b6b61df10b872">SetFarcast</a>(action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a71bdde6b4c48cc74aaaf93d7e14a9460">RadioMessage::FARCAST_TO</a>);</div> +<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  instruction-><a class="code" href="class_instruction.html#acc929a6ecc5fad5f9090243e54738725">SetWeaponsFree</a>(<span class="keyword">false</span>);</div> +<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div> +<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  }</div> +<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  }</div> +<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  }</div> +<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  }</div> +<div class="line"><a name="l00206"></a><span class="lineno"> 206</span> </div> +<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="comment">// formation orders => set formation:</span></div> +<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">if</span> (action >= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aff2c7dfe629618df4225cbcf19ee54ae">RadioMessage::GO_DIAMOND</a> &&</div> +<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  action <= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25afe6da826df078b602b5b10829327bb3d">RadioMessage::GO_TRAIL</a>) {</div> +<div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div> +<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">switch</span> (action) {</div> +<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aff2c7dfe629618df4225cbcf19ee54ae">RadioMessage::GO_DIAMOND</a>: instruction-><a class="code" href="class_instruction.html#aebb3cb9d4276ebae82d94b7c9a56d60a">SetFormation</a>(<a class="code" href="class_instruction.html#a4560c840807f28dbc055eaeed7969ff6a89a8cb9ca6de0cffd8ba2d501e8d08c2">Instruction::DIAMOND</a>); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a377357e9ea0e37ba2a54b0690d92ba7c">RadioMessage::GO_SPREAD</a>: instruction-><a class="code" href="class_instruction.html#aebb3cb9d4276ebae82d94b7c9a56d60a">SetFormation</a>(<a class="code" href="class_instruction.html#a4560c840807f28dbc055eaeed7969ff6af6edd713cb85ad3608c0343ff0babe77">Instruction::SPREAD</a>); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a56c1bc4178dae246b13502cdb462b29b">RadioMessage::GO_BOX</a>: instruction-><a class="code" href="class_instruction.html#aebb3cb9d4276ebae82d94b7c9a56d60a">SetFormation</a>(<a class="code" href="class_instruction.html#a4560c840807f28dbc055eaeed7969ff6afb56b818232cb4eeec687b54b1471434">Instruction::BOX</a>); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25afe6da826df078b602b5b10829327bb3d">RadioMessage::GO_TRAIL</a>: instruction-><a class="code" href="class_instruction.html#aebb3cb9d4276ebae82d94b7c9a56d60a">SetFormation</a>(<a class="code" href="class_instruction.html#a4560c840807f28dbc055eaeed7969ff6a5c34b60a19fa5284c61b61d6b6757693">Instruction::TRAIL</a>); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  }</div> +<div class="line"><a name="l00217"></a><span class="lineno"> 217</span> </div> +<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  posture_only = <span class="keyword">true</span>;</div> +<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  }</div> +<div class="line"><a name="l00220"></a><span class="lineno"> 220</span> </div> +<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="comment">// emcon orders => set emcon:</span></div> +<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">if</span> (action >= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ac305b82af6cfbff0d4791c568beac6c3">RadioMessage::GO_EMCON1</a> &&</div> +<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  action <= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25abccd2f8bcf2fb7a0a68ecf51f192edc7">RadioMessage::GO_EMCON3</a>) {</div> +<div class="line"><a name="l00224"></a><span class="lineno"> 224</span> </div> +<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">switch</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>()) {</div> +<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ac305b82af6cfbff0d4791c568beac6c3">RadioMessage::GO_EMCON1</a>: instruction-><a class="code" href="class_instruction.html#a81ec4e0ce809a394ac228621322d2e04">SetEMCON</a>(1); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7fabf22959ecdd8ce60e8be8cdd93993">RadioMessage::GO_EMCON2</a>: instruction-><a class="code" href="class_instruction.html#a81ec4e0ce809a394ac228621322d2e04">SetEMCON</a>(2); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keywordflow">case</span> <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25abccd2f8bcf2fb7a0a68ecf51f192edc7">RadioMessage::GO_EMCON3</a>: instruction-><a class="code" href="class_instruction.html#a81ec4e0ce809a394ac228621322d2e04">SetEMCON</a>(3); <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  }</div> +<div class="line"><a name="l00230"></a><span class="lineno"> 230</span> </div> +<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  posture_only = <span class="keyword">true</span>;</div> +<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  }</div> +<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> </div> +<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">if</span> (!posture_only) {</div> +<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  instruction-><a class="code" href="class_instruction.html#ada0518fbd58c13d32450afa321dc812d">SetAction</a>(action);</div> +<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  instruction-><a class="code" href="class_instruction.html#a8677ceb0b7e6e06a0b870a1e98e33a5f">ClearTarget</a>();</div> +<div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div> +<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#a19b40193bbf7a6ddeaa1a2362ed9e04b">TargetList</a>().<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>() > 0) {</div> +<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <a class="code" href="class_sim_object.html">SimObject</a>* msg_tgt = msg-><a class="code" href="class_radio_message.html#a19b40193bbf7a6ddeaa1a2362ed9e04b">TargetList</a>().<a class="code" href="class_list.html#a92f41ba1f2810b54d6b47ce727ff9835">at</a>(0);</div> +<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  instruction-><a class="code" href="class_instruction.html#a98860980e323c68e895e39e514b494a7">SetTarget</a>(msg_tgt);</div> +<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  instruction-><a class="code" href="class_instruction.html#a1ddf1c25861d2319955e5b737f387a56">SetLocation</a>(msg_tgt-><a class="code" href="class_physical.html#a18d7b806f29edde8af178ae9a6d0ad90">Location</a>());</div> +<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  }</div> +<div class="line"><a name="l00243"></a><span class="lineno"> 243</span> </div> +<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af7433b1fd306d597871903a612ded3b0">RadioMessage::COVER_ME</a>) {</div> +<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  instruction-><a class="code" href="class_instruction.html#a98860980e323c68e895e39e514b494a7">SetTarget</a>((<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>());</div> +<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  instruction-><a class="code" href="class_instruction.html#a1ddf1c25861d2319955e5b737f387a56">SetLocation</a>(msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>()-><a class="code" href="class_physical.html#a18d7b806f29edde8af178ae9a6d0ad90">Location</a>());</div> +<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  }</div> +<div class="line"><a name="l00248"></a><span class="lineno"> 248</span> </div> +<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ad1acb534c24126048c3abcd4cf331d84">RadioMessage::MOVE_PATROL</a>) {</div> +<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  instruction-><a class="code" href="class_instruction.html#a1ddf1c25861d2319955e5b737f387a56">SetLocation</a>(msg-><a class="code" href="class_radio_message.html#a7fa6d1327033369c91bb0fc667de2b58">Location</a>());</div> +<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  }</div> +<div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div> +<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="comment">// handle element engagement:</span></div> +<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">if</span> (action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aebb3dbda4bef696b3fa43756b42cbe07">RadioMessage::ATTACK</a> && msg-><a class="code" href="class_radio_message.html#a19b40193bbf7a6ddeaa1a2362ed9e04b">TargetList</a>().<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>() > 0) {</div> +<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <a class="code" href="class_element.html">Element</a>* elem = msg-><a class="code" href="class_radio_message.html#a4cb6a22efb1b78090c700211d3495066">DestinationElem</a>();</div> +<div class="line"><a name="l00256"></a><span class="lineno"> 256</span> </div> +<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">if</span> (!elem && msg-><a class="code" href="class_radio_message.html#a2ef2326c84c5e440811e1e8ed0b55472">DestinationShip</a>())</div> +<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  elem = msg-><a class="code" href="class_radio_message.html#a2ef2326c84c5e440811e1e8ed0b55472">DestinationShip</a>()-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div> +<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keywordflow">if</span> (elem) {</div> +<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <a class="code" href="class_sim_object.html">SimObject</a>* msg_tgt = msg-><a class="code" href="class_radio_message.html#a19b40193bbf7a6ddeaa1a2362ed9e04b">TargetList</a>().<a class="code" href="class_list.html#a92f41ba1f2810b54d6b47ce727ff9835">at</a>(0);</div> +<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keywordflow">if</span> (msg_tgt && msg_tgt-><a class="code" href="class_physical.html#a2ce9ae48d2e4f4fb434bdc4083746068">Type</a>() == <a class="code" href="class_sim_object.html#a43f6bd6f43c6e7798b4f7ac729c53982a883a4c0d3bae3a294a55a710f8bd7cf4">SimObject::SIM_SHIP</a>) {</div> +<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <a class="code" href="class_element.html">Element</a>* tgt = ((<a class="code" href="class_ship.html">Ship</a>*) msg_tgt)->GetElement();</div> +<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  elem-><a class="code" href="class_element.html#a94ceb0fc6e23154e63868a015d6aac7e">SetAssignment</a>(tgt);</div> +<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div> +<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#a19b40193bbf7a6ddeaa1a2362ed9e04b">TargetList</a>().<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>() > 1)</div> +<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  instruction-><a class="code" href="class_instruction.html#a98860980e323c68e895e39e514b494a7">SetTarget</a>(tgt-><a class="code" href="class_element.html#ae56e330366d3de4a3e378d422d9c1d95">Name</a>().<a class="code" href="class_text.html#aae848844d712fd439b42fe6fb8d89bd6">data</a>());</div> +<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordflow">else</span></div> +<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  instruction-><a class="code" href="class_instruction.html#a98860980e323c68e895e39e514b494a7">SetTarget</a>(msg_tgt);</div> +<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  }</div> +<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  elem-><a class="code" href="class_element.html#abcbf8da7226cd274845f54759f7e1cdc">ResumeAssignment</a>();</div> +<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  }</div> +<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  }</div> +<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  }</div> +<div class="line"><a name="l00276"></a><span class="lineno"> 276</span> </div> +<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (action == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7cdfe8d3ec2532c654c4979610700da8">RadioMessage::RESUME_MISSION</a>) {</div> +<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <a class="code" href="class_element.html">Element</a>* elem = msg-><a class="code" href="class_radio_message.html#a4cb6a22efb1b78090c700211d3495066">DestinationElem</a>();</div> +<div class="line"><a name="l00279"></a><span class="lineno"> 279</span> </div> +<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">if</span> (!elem && msg-><a class="code" href="class_radio_message.html#a2ef2326c84c5e440811e1e8ed0b55472">DestinationShip</a>())</div> +<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  elem = msg-><a class="code" href="class_radio_message.html#a2ef2326c84c5e440811e1e8ed0b55472">DestinationShip</a>()-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00282"></a><span class="lineno"> 282</span> </div> +<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordflow">if</span> (elem) {</div> +<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  elem-><a class="code" href="class_element.html#abcbf8da7226cd274845f54759f7e1cdc">ResumeAssignment</a>();</div> +<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  }</div> +<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  }</div> +<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  }</div> +<div class="line"><a name="l00288"></a><span class="lineno"> 288</span> </div> +<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  instruction-><a class="code" href="class_instruction.html#acc929a6ecc5fad5f9090243e54738725">SetWeaponsFree</a>(action <= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ac30edb406167e3ddcd52572b2903dc2a">RadioMessage::WEP_FREE</a>);</div> +<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div> +<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  }</div> +<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div> +<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00294"></a><span class="lineno"> 294</span> }</div> +<div class="line"><a name="l00295"></a><span class="lineno"> 295</span> </div> +<div class="line"><a name="l00296"></a><span class="lineno"> 296</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> +<div class="line"><a name="l00297"></a><span class="lineno"> 297</span> </div> +<div class="line"><a name="l00298"></a><span class="lineno"> 298</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00299"></a><span class="lineno"><a class="code" href="class_radio_handler.html#a25a208c606b175e13dda1a3aeee00471"> 299</a></span> <a class="code" href="class_radio_handler.html#a25a208c606b175e13dda1a3aeee00471">RadioHandler::ProcessMessageAction</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00300"></a><span class="lineno"> 300</span> {</div> +<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordflow">if</span> (!msg) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00302"></a><span class="lineno"> 302</span> </div> +<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a83d3c0822a1855980fa75ad6ea665fa7">RadioMessage::CALL_INBOUND</a>)</div> +<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="keywordflow">return</span> <a class="code" href="class_radio_handler.html#a90d8ec2f45382b40152fb94c4e25341d">Inbound</a>(msg, ship);</div> +<div class="line"><a name="l00305"></a><span class="lineno"> 305</span> </div> +<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a5879c1b3e16f7f428ac07eb3bbf71187">RadioMessage::CALL_FINALS</a>)</div> +<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>; <span class="comment">// acknowledge</span></div> +<div class="line"><a name="l00308"></a><span class="lineno"> 308</span> </div> +<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a86b4436086be6c279a0fdbf90166f895">RadioMessage::REQUEST_PICTURE</a>)</div> +<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordflow">return</span> <a class="code" href="class_radio_handler.html#abf0767eeceefd050a5d0243bddbd8cc4">Picture</a>(msg, ship);</div> +<div class="line"><a name="l00311"></a><span class="lineno"> 311</span> </div> +<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25afe75b66b3ea721d3defe3358f7b14854">RadioMessage::REQUEST_SUPPORT</a>)</div> +<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <span class="keywordflow">return</span> <a class="code" href="class_radio_handler.html#ad0accf86e026d951bc5aa86801716277">Support</a>(msg, ship);</div> +<div class="line"><a name="l00314"></a><span class="lineno"> 314</span> </div> +<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ad4d48873938b526293335053afca2128">RadioMessage::SKIP_NAVPOINT</a>)</div> +<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordflow">return</span> <a class="code" href="class_radio_handler.html#a8fd6dbe85ea69170e23634ef71b44821">SkipNavpoint</a>(msg, ship);</div> +<div class="line"><a name="l00317"></a><span class="lineno"> 317</span> </div> +<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a0b246ae995e4e11fcd8530e8dc639d39">RadioMessage::LAUNCH_PROBE</a>)</div> +<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordflow">return</span> <a class="code" href="class_radio_handler.html#ad5f38f84b6b2dcd77b81a4b29ac650c5">LaunchProbe</a>(msg, ship);</div> +<div class="line"><a name="l00320"></a><span class="lineno"> 320</span> </div> +<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> }</div> +<div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div> +<div class="line"><a name="l00324"></a><span class="lineno"> 324</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00325"></a><span class="lineno"><a class="code" href="class_radio_handler.html#a8fd6dbe85ea69170e23634ef71b44821"> 325</a></span> <a class="code" href="class_radio_handler.html#a8fd6dbe85ea69170e23634ef71b44821">RadioHandler::SkipNavpoint</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00326"></a><span class="lineno"> 326</span> {</div> +<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="comment">// Find next Instruction:</span></div> +<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <a class="code" href="class_instruction.html">Instruction</a>* navpt = ship-><a class="code" href="class_ship.html#a738acca96fc9c03139c95f4dfb571f72">GetNextNavPoint</a>();</div> +<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keywordtype">int</span> elem_index = ship-><a class="code" href="class_ship.html#a319b9912d54530ed11d5f75e1a13291a">GetElementIndex</a>();</div> +<div class="line"><a name="l00330"></a><span class="lineno"> 330</span> </div> +<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="keywordflow">if</span> (navpt && elem_index < 2) {</div> +<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  ship-><a class="code" href="class_ship.html#aa88187d5d8da7e2a7040b0e852f3a5c0">SetNavptStatus</a>(navpt, <a class="code" href="class_instruction.html#a2979a7c6c235b740af5cce7116650344a2e196069ac50377f6ae251912b9e06cf">Instruction::SKIPPED</a>);</div> +<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  }</div> +<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div> +<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div> +<div class="line"><a name="l00336"></a><span class="lineno"> 336</span> }</div> +<div class="line"><a name="l00337"></a><span class="lineno"> 337</span> </div> +<div class="line"><a name="l00338"></a><span class="lineno"> 338</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00339"></a><span class="lineno"><a class="code" href="class_radio_handler.html#ad5f38f84b6b2dcd77b81a4b29ac650c5"> 339</a></span> <a class="code" href="class_radio_handler.html#ad5f38f84b6b2dcd77b81a4b29ac650c5">RadioHandler::LaunchProbe</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> {</div> +<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keywordflow">if</span> (ship && ship-><a class="code" href="class_ship.html#a707a72e8e1cd0bed60ce3f3737160546">GetProbeLauncher</a>()) {</div> +<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  ship-><a class="code" href="class_ship.html#aa48218fe2c66ff8604b9f655bb89ec2e">LaunchProbe</a>();</div> +<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordflow">return</span> ship-><a class="code" href="class_ship.html#a47de0a51626dffe3f1b29462f8f616d1">GetProbe</a>() != 0;</div> +<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  }</div> +<div class="line"><a name="l00345"></a><span class="lineno"> 345</span> </div> +<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00347"></a><span class="lineno"> 347</span> }</div> +<div class="line"><a name="l00348"></a><span class="lineno"> 348</span> </div> +<div class="line"><a name="l00349"></a><span class="lineno"> 349</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00350"></a><span class="lineno"><a class="code" href="class_radio_handler.html#a90d8ec2f45382b40152fb94c4e25341d"> 350</a></span> <a class="code" href="class_radio_handler.html#a90d8ec2f45382b40152fb94c4e25341d">RadioHandler::Inbound</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00351"></a><span class="lineno"> 351</span> {</div> +<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <a class="code" href="class_ship.html">Ship</a>* inbound = (<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>();</div> +<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <a class="code" href="class_hangar.html">Hangar</a>* hangar = ship-><a class="code" href="class_ship.html#a56f94aa8913b5fc31c3ce60e0010574b">GetHangar</a>();</div> +<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <a class="code" href="class_flight_deck.html">FlightDeck</a>* deck = 0;</div> +<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <span class="keywordtype">int</span> squadron = -1;</div> +<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="keywordtype">int</span> slot = -1;</div> +<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <span class="keywordtype">bool</span> same_rgn = <span class="keyword">false</span>;</div> +<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> </div> +<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keywordflow">if</span> (inbound && inbound-><a class="code" href="class_sim_object.html#aa15b8215840833436f14f22919cf01f5">GetRegion</a>() == ship-><a class="code" href="class_sim_object.html#aa15b8215840833436f14f22919cf01f5">GetRegion</a>())</div> +<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  same_rgn = <span class="keyword">true</span>;</div> +<div class="line"><a name="l00361"></a><span class="lineno"> 361</span> </div> +<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="comment">// is the sender already inbound to us?</span></div> +<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <span class="keywordflow">if</span> (inbound-><a class="code" href="class_ship.html#a16846a1c1042fc9ab3fbaa5c6e3211c0">GetInbound</a>() &&</div> +<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  inbound-><a class="code" href="class_ship.html#a16846a1c1042fc9ab3fbaa5c6e3211c0">GetInbound</a>()-><a class="code" href="class_inbound_slot.html#a4523db2fe50d27a7ddf6697e92725f25">GetDeck</a>() &&</div> +<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  inbound-><a class="code" href="class_ship.html#a16846a1c1042fc9ab3fbaa5c6e3211c0">GetInbound</a>()-><a class="code" href="class_inbound_slot.html#a4523db2fe50d27a7ddf6697e92725f25">GetDeck</a>()-><a class="code" href="class_flight_deck.html#a13e1bb1f4ef0ce26faee7f5deab15788">GetCarrier</a>() == ship) {</div> +<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <a class="code" href="class_inbound_slot.html">InboundSlot</a>* islot = inbound-><a class="code" href="class_ship.html#a16846a1c1042fc9ab3fbaa5c6e3211c0">GetInbound</a>();</div> +<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  deck = islot-><a class="code" href="class_inbound_slot.html#a4523db2fe50d27a7ddf6697e92725f25">GetDeck</a>();</div> +<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  squadron = islot-><a class="code" href="class_inbound_slot.html#ad5713356240f85f8242fe5be173b20ff">Squadron</a>();</div> +<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  slot = islot-><a class="code" href="class_inbound_slot.html#a479fb5a8474c3b5da3709398243caec0">Index</a>();</div> +<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  }</div> +<div class="line"><a name="l00371"></a><span class="lineno"> 371</span> </div> +<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="comment">// otherwise, find space for sender:</span></div> +<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keywordflow">if</span> (hangar && same_rgn) {</div> +<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="keywordflow">if</span> (hangar-><a class="code" href="class_hangar.html#a09430f461b83b157a635a13268729cb7">FindSlot</a>(inbound, squadron, slot)) {</div> +<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keywordtype">int</span> shortest_queue = 1000;</div> +<div class="line"><a name="l00377"></a><span class="lineno"> 377</span> </div> +<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < ship-><a class="code" href="class_ship.html#a84e3a8fc0b5c7be51b22c36edef7e251">NumFlightDecks</a>(); i++) {</div> +<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <a class="code" href="class_flight_deck.html">FlightDeck</a>* d = ship-><a class="code" href="class_ship.html#a03dad25b3efb091cb27d98263c200446">GetFlightDeck</a>(i);</div> +<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keywordflow">if</span> (d-><a class="code" href="class_flight_deck.html#a3eed27792c0ece94c6989d4d0687fada">IsRecoveryDeck</a>()) {</div> +<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="keywordtype">int</span> nwaiting = d-><a class="code" href="class_flight_deck.html#a86a9a3b8c1e28aedaf87ae07fa34dae3">GetRecoveryQueue</a>().<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>();</div> +<div class="line"><a name="l00382"></a><span class="lineno"> 382</span> </div> +<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keywordflow">if</span> (nwaiting < shortest_queue) {</div> +<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  deck = d;</div> +<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  shortest_queue = nwaiting;</div> +<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  }</div> +<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  }</div> +<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  }</div> +<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  }</div> +<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  }</div> +<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  }</div> +<div class="line"><a name="l00392"></a><span class="lineno"> 392</span> </div> +<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <span class="comment">// if no space (or not a carrier!) wave sender off:</span></div> +<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="keywordflow">if</span> (!deck || !same_rgn || squadron < 0 || slot < 0) {</div> +<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* wave_off = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(inbound, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ae5caab37804239c520c5754d7419848b">RadioMessage::NACK</a>);</div> +<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="keywordflow">if</span> (!hangar)</div> +<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  wave_off-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(<a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.no-hangar"</span>));</div> +<div class="line"><a name="l00398"></a><span class="lineno"> 398</span> </div> +<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!same_rgn) {</div> +<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <span class="keywordtype">char</span> info[256];</div> +<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  sprintf_s(info, <a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.too-far-away"</span>).data(), ship-><a class="code" href="class_sim_object.html#aa15b8215840833436f14f22919cf01f5">GetRegion</a>()-><a class="code" href="class_sim_region.html#a4fb402a63782d520a25954ab9235b1bc">Name</a>());</div> +<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  wave_off-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(info);</div> +<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  }</div> +<div class="line"><a name="l00404"></a><span class="lineno"> 404</span> </div> +<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordflow">else</span></div> +<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  wave_off-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(<a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.all-full"</span>));</div> +<div class="line"><a name="l00407"></a><span class="lineno"> 407</span> </div> +<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(wave_off);</div> +<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  }</div> +<div class="line"><a name="l00411"></a><span class="lineno"> 411</span> </div> +<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <span class="comment">// put sender in recovery queue, if not already there:</span></div> +<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <a class="code" href="class_inbound_slot.html">InboundSlot</a>* inbound_slot = inbound-><a class="code" href="class_ship.html#a16846a1c1042fc9ab3fbaa5c6e3211c0">GetInbound</a>();</div> +<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <span class="keywordtype">int</span> sequence = 0;</div> +<div class="line"><a name="l00415"></a><span class="lineno"> 415</span> </div> +<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <span class="keywordflow">if</span> (!inbound_slot) {</div> +<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  inbound_slot = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_inbound_slot.html">InboundSlot</a>(inbound, deck, squadron, slot);</div> +<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  sequence = deck-><a class="code" href="class_flight_deck.html#a3e535fb076b715fed1e7e6fa2b7cbff7">Inbound</a>(inbound_slot);</div> +<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  }</div> +<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  sequence = inbound_slot-><a class="code" href="class_inbound_slot.html#a479fb5a8474c3b5da3709398243caec0">Index</a>();</div> +<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  }</div> +<div class="line"><a name="l00423"></a><span class="lineno"> 423</span> </div> +<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <span class="comment">// inform sender of status:</span></div> +<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* approach = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(inbound, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a05b6116476395e39282e6f08771aeaec">RadioMessage::CALL_APPROACH</a>);</div> +<div class="line"><a name="l00426"></a><span class="lineno"> 426</span> </div> +<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <span class="keywordflow">if</span> (inbound_slot-><a class="code" href="class_inbound_slot.html#a80407b9c3417dc0155cec01f93bdbd24">Cleared</a>()) {</div> +<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="keywordtype">char</span> info[256];</div> +<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  sprintf_s(info, <a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.cleared"</span>).data(), deck-><a class="code" href="class_system.html#aea36980b3567e8bb9b16ae13cd94fef6">Name</a>());</div> +<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  approach-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(info);</div> +<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  }</div> +<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sequence) {</div> +<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <span class="keywordtype">char</span> info[256];</div> +<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  sprintf_s(info, <a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.sequenced"</span>).data(), sequence, deck-><a class="code" href="class_system.html#aea36980b3567e8bb9b16ae13cd94fef6">Name</a>());</div> +<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  approach-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(info);</div> +<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  }</div> +<div class="line"><a name="l00437"></a><span class="lineno"> 437</span> </div> +<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(approach);</div> +<div class="line"><a name="l00439"></a><span class="lineno"> 439</span> </div> +<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00441"></a><span class="lineno"> 441</span> }</div> +<div class="line"><a name="l00442"></a><span class="lineno"> 442</span> </div> +<div class="line"><a name="l00443"></a><span class="lineno"> 443</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00444"></a><span class="lineno"><a class="code" href="class_radio_handler.html#abf0767eeceefd050a5d0243bddbd8cc4"> 444</a></span> <a class="code" href="class_radio_handler.html#abf0767eeceefd050a5d0243bddbd8cc4">RadioHandler::Picture</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00445"></a><span class="lineno"> 445</span> {</div> +<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <span class="keywordflow">if</span> (!ship) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00447"></a><span class="lineno"> 447</span> </div> +<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="comment">// try to find some enemy fighters in the area:</span></div> +<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <a class="code" href="class_ship.html">Ship</a>* tgt = 0;</div> +<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  <span class="keywordtype">double</span> range = 1e9;</div> +<div class="line"><a name="l00451"></a><span class="lineno"> 451</span> </div> +<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <a class="code" href="class_list_iter.html">ListIter<Contact></a> iter = ship-><a class="code" href="class_ship.html#a020ac1c3a07790d9f88eef601b08045d">ContactList</a>();</div> +<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  <span class="keywordflow">while</span> (++iter) {</div> +<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  <a class="code" href="class_contact.html">Contact</a>* c = iter.<a class="code" href="class_list_iter.html#a70cb1260924c01a38c4a68552120a5e0">value</a>();</div> +<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  <span class="keywordtype">int</span> iff = c-><a class="code" href="class_contact.html#a8d6b667fe8fb635b799091cad00d783f">GetIFF</a>(ship);</div> +<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>  <a class="code" href="class_ship.html">Ship</a>* s = c-><a class="code" href="class_contact.html#ade86a4b0e979ca7f818da017d6eb58ae">GetShip</a>();</div> +<div class="line"><a name="l00457"></a><span class="lineno"> 457</span> </div> +<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  <span class="keywordflow">if</span> (s && s-><a class="code" href="class_ship.html#af24832b308e7b0abfbb4af4043b3a060">IsDropship</a>() && s-><a class="code" href="class_ship.html#a5dce5b323f03453535f4239811d22c26">IsHostileTo</a>(ship)) {</div> +<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <span class="keywordtype">double</span> s_range = <a class="code" href="struct_point.html">Point</a>(msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>()-><a class="code" href="class_physical.html#a18d7b806f29edde8af178ae9a6d0ad90">Location</a>() - s-><a class="code" href="class_physical.html#a18d7b806f29edde8af178ae9a6d0ad90">Location</a>()).length();</div> +<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  <span class="keywordflow">if</span> (!tgt || s_range < range) {</div> +<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  tgt = s;</div> +<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  range = s_range;</div> +<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  }</div> +<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  }</div> +<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  }</div> +<div class="line"><a name="l00466"></a><span class="lineno"> 466</span> </div> +<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  <span class="comment">// found some:</span></div> +<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>  <span class="keywordflow">if</span> (tgt) {</div> +<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  <a class="code" href="class_element.html">Element</a>* sender = msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>()-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>  <a class="code" href="class_element.html">Element</a>* tgt_elem = tgt-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* response = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(sender, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25aebb3dbda4bef696b3fa43756b42cbe07">RadioMessage::ATTACK</a>);</div> +<div class="line"><a name="l00472"></a><span class="lineno"> 472</span> </div> +<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  <span class="keywordflow">if</span> (tgt_elem) {</div> +<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= tgt_elem-><a class="code" href="class_element.html#ab04f719f13d6b4b45fe71c81d88b0200">NumShips</a>(); i++)</div> +<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  response-><a class="code" href="class_radio_message.html#afd49e97a67777cc8756355d0d9d8377c">AddTarget</a>(tgt_elem-><a class="code" href="class_element.html#a0d8d831ad366c226352afd1c39658fda">GetShip</a>(i));</div> +<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  }</div> +<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  response-><a class="code" href="class_radio_message.html#afd49e97a67777cc8756355d0d9d8377c">AddTarget</a>(tgt);</div> +<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>  }</div> +<div class="line"><a name="l00480"></a><span class="lineno"> 480</span> </div> +<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(response);</div> +<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  }</div> +<div class="line"><a name="l00483"></a><span class="lineno"> 483</span> </div> +<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  <span class="comment">// nobody worth killin':</span></div> +<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  <a class="code" href="class_ship.html">Ship</a>* sender = (<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>(); <span class="comment">// cast-away const</span></div> +<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* response = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(sender, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25af31d05a9ff89a5248fd1bfbd40799471">RadioMessage::PICTURE</a>);</div> +<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(response);</div> +<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  }</div> +<div class="line"><a name="l00490"></a><span class="lineno"> 490</span> </div> +<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00492"></a><span class="lineno"> 492</span> }</div> +<div class="line"><a name="l00493"></a><span class="lineno"> 493</span> </div> +<div class="line"><a name="l00494"></a><span class="lineno"> 494</span> <span class="keywordtype">bool</span></div> +<div class="line"><a name="l00495"></a><span class="lineno"><a class="code" href="class_radio_handler.html#ad0accf86e026d951bc5aa86801716277"> 495</a></span> <a class="code" href="class_radio_handler.html#ad0accf86e026d951bc5aa86801716277">RadioHandler::Support</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* ship)</div> +<div class="line"><a name="l00496"></a><span class="lineno"> 496</span> {</div> +<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  <span class="keywordflow">if</span> (!ship) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00498"></a><span class="lineno"> 498</span> </div> +<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  <span class="comment">// try to find some fighters with time on their hands...</span></div> +<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  <a class="code" href="class_element.html">Element</a>* help = 0;</div> +<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>  <a class="code" href="class_element.html">Element</a>* cmdr = ship-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  <a class="code" href="class_element.html">Element</a>* baby = msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>()-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>  <a class="code" href="class_sim_region.html">SimRegion</a>* rgn = msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>()-><a class="code" href="class_sim_object.html#aa15b8215840833436f14f22919cf01f5">GetRegion</a>();</div> +<div class="line"><a name="l00504"></a><span class="lineno"> 504</span> </div> +<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < rgn-><a class="code" href="class_sim_region.html#a3d0ed64b47b7193c1eaaeee8dfcc46bf">Ships</a>().<a class="code" href="class_list.html#a802e2aa9aaef248591140fa032d20d61">size</a>(); i++) {</div> +<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  <a class="code" href="class_ship.html">Ship</a>* s = rgn-><a class="code" href="class_sim_region.html#a3d0ed64b47b7193c1eaaeee8dfcc46bf">Ships</a>().<a class="code" href="class_list.html#a92f41ba1f2810b54d6b47ce727ff9835">at</a>(i);</div> +<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  <a class="code" href="class_element.html">Element</a>* e = s-><a class="code" href="class_ship.html#a791d746356184004b55fa8ad874ac31e">GetElement</a>();</div> +<div class="line"><a name="l00508"></a><span class="lineno"> 508</span> </div> +<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>  <span class="keywordflow">if</span> (e && s-><a class="code" href="class_ship.html#af24832b308e7b0abfbb4af4043b3a060">IsDropship</a>() &&</div> +<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>  e-><a class="code" href="class_element.html#ad9802fedaaeac3bc94ad25fbd4efebcf">Type</a>() == <a class="code" href="class_mission.html#ad05071c7688e1c7d9d140a1da79489e8a2f91564677ffafb87656902c7b1f2a1a">Mission::PATROL</a> &&</div> +<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>  e != baby && </div> +<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>  cmdr-><a class="code" href="class_element.html#ad420f3eb581b74dbb296963a23fefd7a">CanCommand</a>(e) && </div> +<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>  s-><a class="code" href="class_ship.html#ad4b1ede340f2a31d17a82a266c7f3f5b">GetRadioOrders</a>()-><a class="code" href="class_instruction.html#a445a8e3c2e4f3869893125d1b5075bd0">Action</a>() == <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a7c566bca597f923aa05f08ff02ca8049">RadioMessage::NONE</a>) {</div> +<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  help = e;</div> +<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>  <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  }</div> +<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>  }</div> +<div class="line"><a name="l00518"></a><span class="lineno"> 518</span> </div> +<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>  <span class="comment">// found some:</span></div> +<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>  <span class="keywordflow">if</span> (help) {</div> +<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* escort = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(help, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a94f437f89bd938e97777b1df27925871">RadioMessage::ESCORT</a>);</div> +<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>  escort-><a class="code" href="class_radio_message.html#a19b40193bbf7a6ddeaa1a2362ed9e04b">TargetList</a>().<a class="code" href="class_list.html#ab3180edb4da02be2a4b62320071755b8">append</a>(msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>());</div> +<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(escort);</div> +<div class="line"><a name="l00524"></a><span class="lineno"> 524</span> </div> +<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>  <a class="code" href="class_text.html">Text</a> ok = <a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.help-enroute"</span>);</div> +<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>  <a class="code" href="class_ship.html">Ship</a>* sender = (<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>(); <span class="comment">// cast-away const</span></div> +<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* response = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(sender, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a1bfb47ab140e088c91e95e34d847efc0">RadioMessage::ACK</a>);</div> +<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  response-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(ok);</div> +<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(response);</div> +<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  }</div> +<div class="line"><a name="l00531"></a><span class="lineno"> 531</span> </div> +<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  <span class="comment">// no help in sight:</span></div> +<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>  <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>  <a class="code" href="class_text.html">Text</a> nope = <a class="code" href="class_game.html#a80f0de6fe1883b6b0e4c67b3e16afb2f">Game::GetText</a>(<span class="stringliteral">"RadioHandler.no-help-for-you"</span>);</div> +<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>  <a class="code" href="class_ship.html">Ship</a>* sender = (<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>(); <span class="comment">// cast-away const</span></div> +<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* response = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(sender, ship, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ae5caab37804239c520c5754d7419848b">RadioMessage::NACK</a>);</div> +<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  response-><a class="code" href="class_radio_message.html#a00b635ed2120e445b13906e6e00d0ce3">SetInfo</a>(nope);</div> +<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(response);</div> +<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  }</div> +<div class="line"><a name="l00540"></a><span class="lineno"> 540</span> </div> +<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> +<div class="line"><a name="l00542"></a><span class="lineno"> 542</span> }</div> +<div class="line"><a name="l00543"></a><span class="lineno"> 543</span> </div> +<div class="line"><a name="l00544"></a><span class="lineno"> 544</span> <span class="comment">// +----------------------------------------------------------------------+</span></div> +<div class="line"><a name="l00545"></a><span class="lineno"> 545</span> </div> +<div class="line"><a name="l00546"></a><span class="lineno"> 546</span> <span class="keywordtype">void</span></div> +<div class="line"><a name="l00547"></a><span class="lineno"><a class="code" href="class_radio_handler.html#a2fa05f2ee2063f5346dab1bc32ca151c"> 547</a></span> <a class="code" href="class_radio_handler.html#a2fa05f2ee2063f5346dab1bc32ca151c">RadioHandler::AcknowledgeMessage</a>(<a class="code" href="class_radio_message.html">RadioMessage</a>* msg, <a class="code" href="class_ship.html">Ship</a>* s)</div> +<div class="line"><a name="l00548"></a><span class="lineno"> 548</span> {</div> +<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>  <span class="keywordflow">if</span> (s && msg && msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>() && msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>()) {</div> +<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>  <span class="keywordflow">if</span> (msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() >= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a1bfb47ab140e088c91e95e34d847efc0">RadioMessage::ACK</a> && msg-><a class="code" href="class_radio_message.html#aec3eeb224185e11bb4f8867429f1ae3f">Action</a>() <= <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25ae5caab37804239c520c5754d7419848b">RadioMessage::NACK</a>)</div> +<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>  <span class="keywordflow">return</span>; <span class="comment">// nothing to say here</span></div> +<div class="line"><a name="l00552"></a><span class="lineno"> 552</span> </div> +<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>  <a class="code" href="class_ship.html">Ship</a>* sender = (<a class="code" href="class_ship.html">Ship</a>*) msg-><a class="code" href="class_radio_message.html#a77931098f04ee0b5f5cf8c60242b461b">Sender</a>(); <span class="comment">// cast-away const</span></div> +<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>  <a class="code" href="class_radio_message.html">RadioMessage</a>* ack = <span class="keyword">new</span>(__FILE__,__LINE__) <a class="code" href="class_radio_message.html">RadioMessage</a>(sender, s, <a class="code" href="class_radio_message.html#ad12d7f6b9297753a216da6d05eecfd25a1bfb47ab140e088c91e95e34d847efc0">RadioMessage::ACK</a>);</div> +<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  <a class="code" href="class_radio_traffic.html#a12650c86b7d95c5c92f779bc7e754c57">RadioTraffic::Transmit</a>(ack);</div> +<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  }</div> +<div class="line"><a name="l00557"></a><span class="lineno"> 557</span> }</div> +<div class="line"><a name="l00558"></a><span class="lineno"> 558</span> </div> +</div><!-- fragment --></div><!-- contents --> +</div><!-- doc-content --> +<!-- start footer part --> +<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> + <ul> + <li class="navelem"><a class="el" href="dir_ea1b58c809a5070716d7c602998a95b0.html">Stars45</a></li><li class="navelem"><a class="el" href="_radio_handler_8cpp.html">RadioHandler.cpp</a></li> + <li class="footer">Generated on Tue Jun 5 2012 20:47:08 for Starshatter_Open by + <a href="http://www.doxygen.org/index.html"> + <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1 </li> + </ul> +</div> +</body> +</html> |