Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
DotBot

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
489
3,802
19,682
608
UlrikeFinn

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » Bug: spell_animate_dead
Forum Rules | Mark all | Recent Posts

Bug: spell_animate_dead
< Newer Topic :: Older Topic > Doesn't consider specified target..

Pages:<< prev 1 next >>
Post is unread #1 Aug 25, 2024 2:25 pm   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts423
JoinedMar 7, 2005

 
I will submit this under the "how did nobody notice this" category. Sometimes these things truly beggar belief.

The spell, "Animate Dead" which uses spell_animate_dead( ), professes in the help files to take a target parameter. That doesn't actually look to exist in the code, however. Instead, it just finds the first suitable corpse in the room:

     for (corpse = ch->in_room->first_content; corpse; corpse = corpse_next)
    {
	corpse_next = corpse->next_content;

	if (corpse->item_type == ITEM_CORPSE_NPC && corpse->cost != -5)
	{
	   found = TRUE;
	   break;
	}
    }


To me that's either a legit bug or someone gutted the functionality at some point and forgot to update the help file entry to account for the fact that no, there is no targeting capability.

That said, you can fix it pretty easily. Consider adding this just before the above section:

    if ( target_name[0] != '\0' )
    {
        if ( ( corpse = get_obj_here( ch, target_name ) ) == NULL )
        {
        	send_to_char( "You cannot find that here.\r\n", ch );
        	return rSPELL_FAILED;
        }
        else
        if ( corpse->item_type == ITEM_CORPSE_NPC && corpse->cost != -5 )
            found = TRUE;
        else
        {
        	send_to_char( "That's not a suitable corpse.\r\n", ch );
        	return rSPELL_FAILED;        
        }
    }
    
    else 


Or whatever you fancy. Just one suggestion. :imp:

Again, I have no idea how this got missed for so many years on MUDs with active players. Did people truly not care which corpse they animated? Or not notice they often didn't get the one they targeted? :blink:

Post is unread #2 Aug 25, 2024 9:16 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,689
JoinedJan 1, 2002

 
Good catch. I wonder if most places just changed the help files instead of looking for the issue.

Post is unread #3 Aug 25, 2024 10:48 pm   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts423
JoinedMar 7, 2005

 
I never cease to be amazed by some of the things I come across in play testing on an empty development server. :grinning:

Pages:<< prev 1 next >>