This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
4rpl:commands:setunitwantsern [2024/06/13 14:49] – Kalli | 4rpl:commands:setunitwantsern [2024/06/13 18:32] (current) – [Workaround for SetUnitWantsErn(<-uid 0)] Kalli | ||
---|---|---|---|
Line 23: | Line 23: | ||
<code 4rpl> | <code 4rpl> | ||
# A unit that has an ERN slotted and receives the 4rpl command to "not want an ERN", | # A unit that has an ERN slotted and receives the 4rpl command to "not want an ERN", | ||
- | # will not actually unequip the ERN. As a workaround it is possible to destroy the unit | + | # will not actually unequip the ERN. As a workaround, it is possible to destroy the unit |
- | # and recreate it without the ERN. That's what this function is for. The function supposes | + | # and recreate it without the ERN. That's what this function is for. |
- | # that the unit that has to lose the ERN, is already constructed, | + | |
- | # be the case. | + | |
- | <-uid GetUnitWantsErn not GetUnitErnState AND if | + | <-uid GetUnitWantsErn not < |
<-uid @freeErnFromUnit | <-uid @freeErnFromUnit | ||
endif | endif | ||
Line 34: | Line 32: | ||
: | : | ||
->UID | ->UID | ||
- | <-UID getunittype <-UID getunitposition <-UID getunitsettings createunit dup -> | + | |
+ | | ||
+ | # Resources that are on the way to the old unit will be lost. | ||
| | ||
# Enable/ | # Enable/ |