Players behave different in Editor

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Sascha
Posts: 348
Joined: Fri May 12, 2006 6:17 pm
Location: Germany
Contact:

Players behave different in Editor

Post by Sascha »

If you choose the yellow player 1 from
the list and drag it over the screen
(with the function "draw single element")
there can be only one player.
If you do the same with players 2, 3 or 4
there can be an infinite amount of players.
Why?
Image
Nathan H.
Posts: 74
Joined: Mon Sep 10, 2007 8:03 pm
Location: USA

Post by Nathan H. »

Must have been a feature added in the early times of the level editor, I guess. It happens only with player 1, and only with that tool, so it really doesn't effect me since I use the line tool most of the time... but hm, I never realized it didn't do that for players 2-4. Were they added later or something? That would cause it.
User avatar
Sascha
Posts: 348
Joined: Fri May 12, 2006 6:17 pm
Location: Germany
Contact:

Post by Sascha »

> Were they added later or something? That would cause it.

Probably. BTW: I mostly use the "filled rectangle" tool!
Image
Daniel H.
Posts: 535
Joined: Sun Apr 02, 2006 7:13 pm
Location: USA

Post by Daniel H. »

Suggested fix: Make the following changes to editor.c:

Find the comment /* remove player at old position */ (line 10676 in R'n'D 3.3.0.1).
Change if (new_element == EL_PLAYER_1) to if (new_element >= EL_PLAYER_1 && new_element <= EL_PLAYER_4)
and change if (Feld[x][y] == EL_PLAYER_1) to if (Feld[x][y] == new_element).
Zomis
Posts: 1501
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Or even better, use the "ELEM_IS_PLAYER" function, as the same behavior should also be for Murphy, our Supaplex friend.
Daniel H.
Posts: 535
Joined: Sun Apr 02, 2006 7:13 pm
Location: USA

Post by Daniel H. »

Good point; Murphy needs to be included too.

In addition to Murphy, that would also cover the "Sokoban field with player." But that should probably be replaced with sokoban field rather than empty space. So that makes it a little more complicated...
Post Reply