Issue information

Issue ID
#6727
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Sep 22, 2012 0:40
Last Post
Hercules Elf Bot
Sep 22, 2012 18:12
Confirmation
Yes (2)
No (0)

Hercules Elf Bot - Sep 22, 2012 0:40

Originally posted by [b]Brynner[/b]
when you type @go mora it will warped you to moroc instead of mora map. but when you type @warp mora there is no problem. im just using the latest revision.

Hercules Elf Bot - Sep 22, 2012 3:39

Originally posted by [b]Euphy[/b]
@go only compares the first three letters, so this would be a problem.
[code] } else if (strncmp(map_name, "morocc", 3) == 0) {
town = 1;
...
} else if (strncmp(map_name, "mora", 3) == 0) {
town = 31;[/code]

Hercules Elf Bot - Sep 22, 2012 4:45

Originally posted by [b]Spre[/b]
w00t my first rathena stroke of genious and it works just tested it!

If you change morroc entry to..

[CODE]
} else if (strncmp(map_name, "morocc", 4) == 0) {
town = 1;
} else if (strncmp(map_name, "mora", 4) == 0) {
town = 31;
[/CODE]

@go mora takes you to mora,

looks like there were other conflicts in the @go and that was the remedy(name wise and i saw the remedy AFTER i changed it :P)

can i hab candy now plz? :P

e
dit:

Oops i only posted have the code LMAO you change morocc AND moras coding and it works perfectly! .. that is if you type @go morocc instead of @go morroc when you are testing it LOL

This post has been edited by Spre on Sep 22, 2012 4:59

Hercules Elf Bot - Sep 22, 2012 8:48

Originally posted by [b]Brynner[/b]
just make this only [color=#666600][size=2]}[/size][/color][color=#000000][size=2] [/size][/color][color=#000088][size=2]else[/size][/color][color=#000000][size=2] [/size][/color][color=#000088][size=2]if[/size][/color][color=#000000][size=2] [/size][/color][color=#666600][size=2]([/size][/color][color=#000000][size=2]strncmp[/size][/color][color=#666600][size=2]([/size][/color][color=#000000][size=2]map_name[/size][/color][color=#666600][size=2],[/size][/color][color=#000000][size=2] [/size][/color][color=#008800][size=2]"morocc"[/size][/color][color=#666600][size=2],[/size][/color][color=#000000][size=2] [/size][/color][color=#006666][size=2]4[/size][/color][color=#666600][size=2])[/size][/color][color=#000000][size=2] [/size][/color][color=#666600][size=2]==[/size][/color][color=#000000][size=2] [/size][/color][color=#006666][size=2]0[/size][/color][color=#666600][size=2])[/size][/color][color=#000000][size=2] [/size][/color][color=#666600][size=2]{ [/size][/color]
[color=#666600][size=2]no need to change the mora.[/size][/color]

Hercules Elf Bot - Sep 22, 2012 13:32

Originally posted by [b]Spre[/b]
If you only edit

[CODE]
} else if (strncmp(map_name, "morocc", 4) == 0) {
town = 1;
[/CODE]

@go mora sends you to mora, but @go morroc also sends you to mora


with both changed from 3 to 4, each one sends you to the right place when the full name is typed out.

Hercules Elf Bot - Sep 22, 2012 15:29

Originally posted by [b]Euphy[/b]
I would suggest instead to place the mora check before morocc, given the spelling discrepancy between "Morocc" and "Morroc":
[code] } else if (strncmp(map_name, "mora", 4) == 0) { //Increase comparison to 4.
town = 31;
} else if (strncmp(map_name, "morocc", 3) == 0) {
town = 1;
...[/code]

This post has been edited by Euphy on Sep 22, 2012 15:48

Hercules Elf Bot - Sep 22, 2012 17:00

Originally posted by [b]Spre[/b]
it is spelled morocc everywhere in the server side files and I believe client side aswell, so when spelled right , it won't be an issue,


I myself have never used @go mapname, I always have reserved @go NUMBER and used @warp map_name

but if you wanted then this should be the solution, same way multiple maps with multiple names are defined, but I only looked at it for..... 2 minutes.

[CODE]
} else if (strncmp(map_name, "morocc", 4) == 0 ||
strncmp(map_name, "morroc", 4 == 0) {
town = 1;
[/CODE]


I still believe 4 should be on all 3, when i tested the change by just changing one value it defaulted to mora after only changing morroc and vice versa with changing mora it took me to morroc.

Hercules Elf Bot - Sep 22, 2012 17:02

Originally posted by [b]Brian[/b]
How about increase strncmp to 4, and add "morroc" as an alternate spelling for morocc. (Keeping the towns in numeric order.)

[codebox] } else if (strncmp(map_name, "morocc", 4) == 0 ||
strncmp(map_name, "morroc", 4) == 0) {
town = 1;
...
} else if (strcmp(map_name, "mora") == 0) {
town = 31;
[/codebox]

PS: Spre, do you want to commit?

This post has been edited by Brian on Sep 22, 2012 17:21

Hercules Elf Bot - Sep 22, 2012 18:12

Originally posted by [b]Spre[/b]
Fixed at [rev=16791]

Cuz i goofed like a goober

This post has been edited by Spre on Sep 22, 2012 18:20