* Get the priority a target has for the current unit. * * Stack: 1 - The encoded target. * * @param script The script engine to operate on. * @return The priority of the target. */
| 94 | * @return The priority of the target. |
| 95 | */ |
| 96 | uint16 Script_Unit_GetTargetPriority(ScriptEngine *script) |
| 97 | { |
| 98 | Unit *u; |
| 99 | Unit *target; |
| 100 | Structure *s; |
| 101 | uint16 encoded; |
| 102 | |
| 103 | u = g_scriptCurrentUnit; |
| 104 | encoded = STACK_PEEK(1); |
| 105 | |
| 106 | target = Tools_Index_GetUnit(encoded); |
| 107 | if (target != NULL) return Unit_GetTargetUnitPriority(u, target); |
| 108 | |
| 109 | s = Tools_Index_GetStructure(encoded); |
| 110 | if (s == NULL) return 0; |
| 111 | |
| 112 | return Unit_GetTargetStructurePriority(u, s); |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Delivery of transport, either to structure or to a tile. |
nothing calls this directly
no test coverage detected