HerculesWS / Hercules

Hercules is a collaborative software development project revolving around the creation of a robust massively multiplayer online role playing game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. Hercules is a continuation of the original Athena project.
http://herc.ws
GNU General Public License v3.0
900 stars 758 forks source link

Self Destruction Skill #959

Open Asheraf opened 8 years ago

Asheraf commented 8 years ago

there a problem on self destruction skill just the same on this link https://rathena.org/board/tracker/issue-8941-problem-in-self-destruction-skill/

AnnieRuru commented 8 years ago

confirmed ? I tested it already http://herc.ws/board/topic/11416-self-destruction-999999/ I just can't reproduce it

though, the knockback isn't update to the client side

Jedzkie commented 8 years ago

@AnnieRuru Not the NPC_SELFDESTRUCTION but the NC_SELFDESTRUCTION

AnnieRuru commented 8 years ago

oh @_@

prontera,155,188,0  script  sdkfjhsfk   1_F_MARIA,{
    jobchange Job_Mechanic;
    skill NC_MADOLICENCE, 1, 0; 
//  setmount(MOUNT_MADO); // no idea why it didn't work
    if ( !checkmount() ) atcommand "@mount";
    getitem Suicidal_Device, 1;
    equip Suicidal_Device;
    getitem Magic_Gear_Fuel, 3;
    skill NC_SELFDESTRUCTION, 1, 0;
    Hp = 1;
    Sp = 1;

    monster "this", -1,-1, "--ja--", PORING,1, "";
}

yeah reproduced

MishimaHaruna commented 8 years ago

This is a problem with unsigned variables. They're generally tricky to use (unless one understands very well what their use implies), and, considering there are very little benefits in using them, we should refrain from using unsigned variables everywhere.

While it's possible to work around this specific issue, my advise is that we change various variables to signed, so that code maintenance becomes easier.

I understand this is a very controversial topic but changing a variable to unsigned to increase its range is rarely a good idea (it's usually better to just increase its size), just how it is very wrong to define a variable as unsigned to simply document that it won't be negative (assertions should be used for that). The only places where unsigned variables should be used are in bitmasks and when bit-shift operations are to be used.