New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"On Event Touch" events with "same level as hero" are executed on the tile the hero teleports to #1086

Closed
Ghabry opened this Issue Jan 11, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@Ghabry
Member

Ghabry commented Jan 11, 2017

Let the hero teleport on a tile with "Event touch" attribute that has "same level as hero" priority. The event is executed. This is wrong. (Only below and above are executed).
For "On Hero Touch" the behaviour is correct -> The event is NOT executed at all, so is probably an easy fix when you can find the code.


Please fill in the following fields before submitting an issue:

Name of the game: Sternenkindsaga

Attach files (as a .zip archive or link them)

Savegame: Save03.lsd.zip

Describe the issue in detail and how to reproduce it:

Move to the left, after the short dialog you are teleported back.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Jan 11, 2017

Member

Sorry, made a mistake while testing this bug. That's NOT the actual reason >.>. Will reopen with an edited title when I found it...

Member

Ghabry commented Jan 11, 2017

Sorry, made a mistake while testing this bug. That's NOT the actual reason >.>. Will reopen with an edited title when I found it...

@Ghabry Ghabry closed this Jan 11, 2017

@Ghabry Ghabry added the Invalid label Jan 11, 2017

@Ghabry Ghabry changed the title from "On Event Touch" events are executed on the tile the hero teleports to to "On Event Touch" events with "same level as hero" are executed on the tile the hero teleports to Jan 11, 2017

@Ghabry Ghabry removed the Invalid label Jan 11, 2017

@Ghabry Ghabry reopened this Jan 11, 2017

@scurest

This comment has been minimized.

Show comment
Hide comment
@scurest

scurest Mar 1, 2017

Contributor

The change should go in Game_Event::CheckEventTriggerTouch, I think. I don't know what the exact change should be. The below patch fixes Sternenkind-Saga in particular, but I don't really understand what the x and y parameters are for (used during diagonal movement?) (and also I don't know if it breaks anything 😅)

diff --git a/src/game_event.cpp b/src/game_event.cpp
index e44eb878..9f709e0b 100644
--- a/src/game_event.cpp
+++ b/src/game_event.cpp
@@ -511,6 +511,10 @@ bool Game_Event::CheckEventTriggerTouch(int x, int y) {
 		return false;
 
 	if (trigger == RPG::EventPage::Trigger_collision && !IsJumping()) {
+		if (Main_Data::game_player->IsInPosition(GetX(), GetY()) && GetLayer() == RPG::EventPage::Layers_same) {
+			return false;
+		}
+
 		if (Main_Data::game_player->IsInPosition(x, y) && !Main_Data::game_player->IsBlockedByMoveRoute()) {
 			if (Main_Data::game_player->InAirship() && GetLayer() == RPG::EventPage::Layers_same) {
 				return false;
Contributor

scurest commented Mar 1, 2017

The change should go in Game_Event::CheckEventTriggerTouch, I think. I don't know what the exact change should be. The below patch fixes Sternenkind-Saga in particular, but I don't really understand what the x and y parameters are for (used during diagonal movement?) (and also I don't know if it breaks anything 😅)

diff --git a/src/game_event.cpp b/src/game_event.cpp
index e44eb878..9f709e0b 100644
--- a/src/game_event.cpp
+++ b/src/game_event.cpp
@@ -511,6 +511,10 @@ bool Game_Event::CheckEventTriggerTouch(int x, int y) {
 		return false;
 
 	if (trigger == RPG::EventPage::Trigger_collision && !IsJumping()) {
+		if (Main_Data::game_player->IsInPosition(GetX(), GetY()) && GetLayer() == RPG::EventPage::Layers_same) {
+			return false;
+		}
+
 		if (Main_Data::game_player->IsInPosition(x, y) && !Main_Data::game_player->IsBlockedByMoveRoute()) {
 			if (Main_Data::game_player->InAirship() && GetLayer() == RPG::EventPage::Layers_same) {
 				return false;
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Mar 1, 2017

Member

I only see one place where x,y are used and this is when the tile is not passable and then it triggers the touch event when you collide with it instead of walking on.

Your patch looks good to me 👍

Member

Ghabry commented Mar 1, 2017

I only see one place where x,y are used and this is when the tile is not passable and then it triggers the touch event when you collide with it instead of walking on.

Your patch looks good to me 👍

scurest added a commit to scurest/Player that referenced this issue Mar 3, 2017

If player/event are incident, don't trigger touch
Fixes #1086.

Also, fix a bug where characters whose sprite is a chip from the
chipset didn't trigger collisions.

@Ghabry Ghabry closed this in #1108 Mar 4, 2017

Ghabry pushed a commit to libretro/easyrpg-libretro that referenced this issue May 22, 2018

If player/event are incident, don't trigger touch
Fixes #1086.

Also, fix a bug where characters whose sprite is a chip from the
chipset didn't trigger collisions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment