| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 1 | RemoveItem() |
| 2 | ============ | ||||
| 3 | |||||
| 4 | FUNKTION | ||||
| 5 | -------- | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 6 | |
| Bugfix | d8ddba8 | 2020-11-02 11:20:24 +0100 | [diff] [blame] | 7 | void RemoveItem(<string|string*> file); |
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 8 | |
| 9 | DEFINIERT IN | ||||
| 10 | ------------ | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 11 | |
| Bugfix | d8ddba8 | 2020-11-02 11:20:24 +0100 | [diff] [blame] | 12 | /std/container/items.c |
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 13 | |
| 14 | ARGUMENTE | ||||
| 15 | --------- | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 16 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 17 | file |
| 18 | String oder Array von Strings mit dem Namen des zu entfernenden | ||||
| 19 | Objekts. | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 20 | |
| 21 | BESCHREIBUNG | ||||
| 22 | ------------ | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 23 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 24 | Das mit AddItem(file) dem Raum hinzugefuegte Objekt wird wieder aus |
| 25 | der Liste der Objekte entfernt. | ||||
| 26 | Wurde bei AddItem() ein Array von Dateinamen uebergeben, so muss das | ||||
| 27 | selbe Array auch bei RemoveItem() uebergeben werden! | ||||
| Bugfix | d8ddba8 | 2020-11-02 11:20:24 +0100 | [diff] [blame] | 28 | Falls das Objekt, das durch den AddItem()-Aufruf erzeugt wurde, sich noch |
| 29 | innerhalb des Objektes befindet, an dem RemoveItem() aufgerufen wird, wird | ||||
| 30 | es dadurch zerstoert. | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 31 | |
| 32 | RUECKGABEWERT | ||||
| 33 | ------------- | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 34 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 35 | keiner |
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 36 | |
| Bugfix | e64024a | 2020-11-02 11:28:25 +0100 | [diff] [blame] | 37 | BEMERKUNGEN |
| 38 | ----------- | ||||
| 39 | |||||
| 40 | RemoveItem() loest im Gegensatz zu AddItem() bei NPCs keine Meldung aus, da | ||||
| 41 | diese nur zerstoert und nicht bewegt werden. Wird hier eine Meldung | ||||
| 42 | gewuenscht, muss diese selbst ausgegeben werden. | ||||
| 43 | |||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 44 | BEISPIELE |
| 45 | --------- | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 46 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 47 | Ein muellschluckerfreier Laden laesst sich wie folgt erzeugen: |
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 48 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 49 | .. code-block:: pike |
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 50 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 51 | inherit "/std/laden"; |
| 52 | #include <properties.h> | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 53 | |
| Bugfix | d8ddba8 | 2020-11-02 11:20:24 +0100 | [diff] [blame] | 54 | protected void create() |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 55 | { |
| 56 | ::create(); // Hier wird u.a. der Muellschlucker erzeugt | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 57 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 58 | RemoveItem("/obj/entsorg"); // und weg damit! |
| 59 | |||||
| 60 | SetProp(...); // und die normale Beschreibung... | ||||
| 61 | } | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 62 | |
| 63 | SIEHE AUCH | ||||
| 64 | ---------- | ||||
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 65 | |
| Bugfix | 6446fd2 | 2020-11-02 11:17:26 +0100 | [diff] [blame] | 66 | :doc:`AddItem`, /std/room/items.c |
| Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 67 | |
| Bugfix | e64024a | 2020-11-02 11:28:25 +0100 | [diff] [blame] | 68 | Letzte Aenderung: 02.11.2020, Bugfix |