Maybe... a Bug?

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Dret
Posts: 79
Joined: June 13th, 2007, 11:06 pm
Contact:

Maybe... a Bug?

Post by Dret »

Hi to all...

I want to expose a strange situation that take effect using teleport feature.

I have a [set_menu_item] with possibility for player's leaders to "teleport" themself around the map.
Scenario is a 1 vs 1 battle (so we have only 2 players)

I used this code:

At first a MACRO to find the coordinates of side leader:

Code: Select all

#define FIND_COO_LEADERS SIDE VAR1 TO_VAR1 VAR2 TO_VAR2
    [store_unit]
        [filter]
			side={SIDE}
			canrecruit=yes
        [/filter]	
		
        kill=no
        variable=leader_pos
    [/store_unit]

    [set_variable]
        name={TO_VAR1}
        format=$leader_pos.{VAR1}
    [/set_variable]
    
        [set_variable]
        name={TO_VAR2}
        format=$leader_pos.{VAR2}
    [/set_variable]


    [clear_variable]
        name=leader_pos
    [/clear_variable]
#enddef
then the code to teleport unit.... into the new location:

Code: Select all

{FIND_COO_LEADERS $side_number x Lx y Ly}
	
 {TELEPORT_UNIT (x,y=$Lx,$Ly side=$side_number canrecruit=yes) $x1 $y1}	
{FLOATING_TEXT x,y=$x1,$y1 0,0,255 "BLINK!"}	
The teleport event works... PERFECTLY... but something strange happens when the leader unit is teleported over a village:

If Player 1 leader is teleported on an empty village this become... OWNED by ENEMY (player 2!) :shock: :shock:

If Player 2 leader is teleported on an empty village, this last remain the same... (not owned by any players!!) :annoyed: :annoyed:

Maybe a Wesnoth Bug...???!!!

Thanks!
Bye
:mrgreen:
Last edited by Dret on May 7th, 2008, 12:15 am, edited 1 time in total.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Maybe... a Bug?

Post by Sapient »

sounds like a bug
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Dret
Posts: 79
Joined: June 13th, 2007, 11:06 pm
Contact:

Re: Maybe... a Bug?

Post by Dret »

Do You suggest me to send a report to code developers...??
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Maybe... a Bug?

Post by Sapient »

yes, those silly "developer" people probably want to know about it ;)

bugs.wesnoth.org
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Iris
Site Administrator
Posts: 6799
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Maybe... a Bug?

Post by Iris »

Sapient wrote:yes, those silly "developer" people...
Huh? :hmm:
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Re: Maybe... a Bug?

Post by Noyga »

It looks like a +/-1 offset somewhere in the C++ code (internal side number = WML & displayed side number -1 IIRC)...
Probably easy to fix (if it hasn't been fixed yet in SVN ;)).
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Re: Maybe... a Bug?

Post by Noyga »

I fixed this bug, so it will be fixed in the next available scenarios.
Note that this might produce OOS error on scenarios that use [teleport] to a village with 1.4.3+ and 1.4.2- clients, anyway i'm not aware of any (and for this reason it might be reverted before 1.4.3 if other devs feel unconfortable with this minor incompatibility).
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
Post Reply