Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #004984

  • 1 - Low

  • Fixed

Issue Confirmations

  • Yes (4)No (0)
Photo

wrong test duplicate npc sample

Posted by Hercules Bot on 27 June 2011 - 01:03 PM

Originally posted by ~AnnieRuru~
http://www.eathena.w...er&showbug=4984

http://eathena-proje...t_duplicate.txt

CODE
// Outcome (r11216 trunk):
// * the variables are _shared_ between all duplicates
yes it is
if you test this script these 3 porings always tells you same coordinate,
because the npc variable overwriting each other

it should use an array or getd ...


maybe something like this
CODE
-    script    Test Script    -1,1,1,{
    mes "Hi.";
    set .@id, atoi( strnpcinfo(2) );
    mes "My coords are "+ .map$[.@id] +", "+ .x[.@id] +"/" +.y[.@id];
    close;

OnInit:
    set .@id, atoi( strnpcinfo(2) );
    getmapxy .map$[.@id], .x[.@id], .y[.@id], 1;
    end;

OnTouch:
    emotion e_scissors;
    end;
}

prontera,150,175,4    duplicate(Test Script)    Test1#1    909
prontera,155,175,4    duplicate(Test Script)    Test2#2    909,2,2
prontera,160,175,4    duplicate(Test Script)    Test3#3    909,3,3

but please do not revert the npc variable to not sharing among duplicates,
because some of our event scripts which uses duplicates already adept to this system

This post has been edited by ~AnnieRuru~: Jun 27 2011, 06:03 AM

Originally posted by GodLesZ
Uhm.. maybe its to early for me, but shouldnt the OnTouch event overwrite the existing .map$ and coordinate variables?
Therefore the coordinates should be different.

Originally posted by Kenpachi
Temporary NPC variables should be flushed when the instance runs out. So in my opinion the sample should use permanent variables.

Originally posted by Kenpachi
I just tested the script and it's true that the duplicates share the variables. All three showed "My coords are prontera, 155/175".

That's something a core dev should take care of ASAP I think!

this is not a core problem it is a documentation problem (npcs duplicates have been modified to be a link to the original npc script instead of a actual duplicate loong time ago in eathena). moving to documentation.

Ind 
moved issue from Core

changed severity to: 1 - Low
changed status to: Started

fixed in
https://github.com/H...060d0fc56d265b6

when I test with this script, I always get this result
[Debug]: script debug : 0 110000003 : Test3
[Debug]: script debug : 0 110000002 : Test2
[Debug]: script debug : 0 110000001 : Test1
[Debug]: script debug : 0 110000000 : Test Script
it anyone gets a different result please tell

changed status to: Fixed