* Set the state for the current structure. * * Stack: 1 - The state. * * @param script The script engine to operate on. * @return The value 0. Always. */
| 52 | * @return The value 0. Always. |
| 53 | */ |
| 54 | uint16 Script_Structure_SetState(ScriptEngine *script) |
| 55 | { |
| 56 | Structure *s; |
| 57 | int16 state; |
| 58 | |
| 59 | s = g_scriptCurrentStructure; |
| 60 | state = STACK_PEEK(1); |
| 61 | |
| 62 | if (state == STRUCTURE_STATE_DETECT) { |
| 63 | if (s->o.linkedID == 0xFF) { |
| 64 | state = STRUCTURE_STATE_IDLE; |
| 65 | } else { |
| 66 | if (s->countDown == 0) { |
| 67 | state = STRUCTURE_STATE_READY; |
| 68 | } else { |
| 69 | state = STRUCTURE_STATE_BUSY; |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | Structure_SetState(s, state); |
| 75 | |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Remove fog around the current structure. |
nothing calls this directly
no test coverage detected