Wrong description for script function pcblockmove(<id>,<flag>);
Wrong description for script function pcblockmove(<id>,<flag>);
Warning! This is the old Hercules bugtracker archive, and may not reflect the current state of Hercules. The current bugtracker is on GitHub Issues.
Issue information
Issue ID
#6894
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Nov 13, 2012 17:19
Last Post
Hercules Elf Bot
Nov 24, 2012 20:44
Confirmation
N/A
Hercules Elf Bot - Nov 13, 2012 17:19
Originally posted by [b]_Okuz_[/b] Hello,
I'm here to report some issues related to this command.
script_commands.txt:
[quote]*pcblockmove <id>,<option>;
Prevents the given ID from moving when the option != 0, 0 enables the ID to move again.
ID should be able to be GID of a monster/NPC or AID from a character.
Examples:
//prevents the current char from moving away;
pcblockmove getcharid(3),1;
//enables the current char to move again.
pcblockmove getcharid(3),0;[/quote]
Source Code (script.c):
[CODE]BUILDIN_FUNC(pcblockmove)
{
int id, flag;
TBL_PC *sd = NULL;
id = script_getnum(st,2);
flag = script_getnum(st,3);
if (id)
sd = map_id2sd(id);
else
sd = script_rid2sd(st);
if (sd)
sd->state.blockedmove = flag > 0;
return 0;
}
BUILDIN_DEF(pcblockmove,"ii"),[/CODE]
According to source code, ID is not really necessary because it'll use player's RID instead of ID if ID was not found. But, WTF? The BUILDIN_DEF says that I must put ID.. So, something is wrong here.. And besides that, I'm not sure if it'll block Monsters and NPCs because sd is a pointer to TBL_PC.
Anyways, can someone take a look please?
Thanks.
PS: I'm sorry about my grammar haha
This post has been edited by
_Okuz_
on Nov 13, 2012 17:23
Hercules Elf Bot - Nov 13, 2012 17:52
Originally posted by [b]Brian[/b] [code]pcblockmove 0, <flag>;[/code]
You could pass it 0 for the RID and it will use the currently attached RID.
This post has been edited by
Brian
on Nov 13, 2012 17:53
Hercules Elf Bot - Nov 13, 2012 20:26
Originally posted by [b]_Okuz_[/b] Well, I'm just suggesting you to change the description in script_commands.txt to something like: [b][size=4][color=#282828][font=helvetica, arial, sans-serif][background=rgb(247, 247, 247)]ID can be AID from a character or 0 for current RID. [/background][/font][/color][/size][/b]I just noticed that some commands in script_commands.txt sometimes have lack of information or wrong information, so I decided to help you guys by reporting what I think is wrong.
Thanks!
This post has been edited by
_Okuz_
on Nov 13, 2012 20:56
Hercules Elf Bot - Nov 19, 2012 19:11
Originally posted by [b]Akkarin[/b]
Updating status to: Started
Hercules Elf Bot - Nov 24, 2012 20:44
Originally posted by [b]Euphy[/b] Fixed in [rev=16963], thanks!