Login
User Name:

Password:



Register

Forgot your password?
 Smaug muds with a Player Base
Jan 15, 2025 3:23 am
By EthanFinn
 Array out of bounds ?
Jan 14, 2025 10:00 pm
By Samson
 AFKMud 2.5.0
Jan 14, 2025 3:27 pm
By Samson
time_update
Jan 12, 2025 9:53 pm
By Remcon
pwd memory leak
Jan 11, 2025 6:31 pm
By Samson
AFKMud 2.5.0
Author: AFKMud Team
Submitted by: Samson
SWFotEFUSS 1.5.2
Author: Various
Submitted by: Samson
SWRFUSS 1.4.2
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.6
Author: Various
Submitted by: Samson
AFKMud 2.2.5
Author: AFKMud Team
Submitted by: Samson
Users Online
Anthropic, Bing, AhrefsBot

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
500
3,824
19,774
591
EthanFinn

» 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
Posts424
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,722
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
Posts424
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 >>