Login
User Name:

Password:



Register

Forgot your password?
IPv6
Jan 25, 2025 10:45 pm
By Samson
mudstrlcpy and mudstrlcat
Jan 18, 2025 5:23 pm
By Samson
I3 and IMC
Jan 17, 2025 9:35 pm
By Samson
AFKMud 2.5.1
Jan 17, 2025 2:22 pm
By Samson
Array out of bounds ?
Jan 16, 2025 4:48 am
By Remcon
SmaugFUSS 1.9.7
Author: Various
Submitted by: Samson
AFKMud 2.5.1
Author: AFKMud Team
Submitted by: Samson
Kayle's Weather Code for AFKMud
Author: Kayle
Submitted by: Samson
AFKMud 2.5.0
Author: AFKMud Team
Submitted by: Samson
SWFotEFUSS 1.5.2
Author: Various
Submitted by: Samson
Users Online
Anthropic, GPTBot, AhrefsBot, Bytespider, Bing, Seznam.cz, Google

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
503
3,811
19,714
589
xhuul

» 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
Posts428
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,706
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
Posts428
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 >>