Login
User Name:

Password:



Register

Forgot your password?
void nanny_get_new_race -- comm.c
Feb 16, 2025 1:25 am
By Elwood
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
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
CommonCrawl, Google, AhrefsBot

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
503
3,812
19,715
590
iasiney

» SmaugMuds » General » Coding » obj_cast_spell possible bug?
Forum Rules | Mark all | Recent Posts

obj_cast_spell possible bug?
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jun 4, 2023 9:26 pm   
Go to the top of the page
Go to the bottom of the page

Vladaar
Apprentice
GroupMembers
Posts57
JoinedNov 24, 2016

 
I think I might have found a bug. Only affects non code spell_smaug spells.

obj_cast_spell ignores obj->value[0] when it goes to hard coded spell that has level set.

For instance af.level = ch->level in a hard coded spell

I have the spell fly coded to af.level = ch->level so if a object has fly spell as brandish.

Instead of looking for obj->value[0] for spell level the builder sets it too, it goes right to spell_fly af.level

Anyway, maybe not a bug anyone else still has, but I have it.

Post is unread #2 Jun 5, 2023 5:39 pm   Last edited Jun 5, 2023 5:40 pm by Vladaar
Go to the top of the page
Go to the bottom of the page

Vladaar
Apprentice
GroupMembers
Posts57
JoinedNov 24, 2016

 
Maybe this is a old bug that Druid fixed years ago, but I think smaugfuss has same function.

I think the way to fix it, is to use skill_lookup function like spec fun stuff does instead of return retcode that obj_cast_spell currently does. Than you could still change the level to obj->value[0].
Prob could still retcode return if skill->type smaug_spell

Post is unread #3 Jun 5, 2023 7:27 pm   Last edited Jun 5, 2023 7:31 pm by Vladaar
Go to the top of the page
Go to the bottom of the page

Vladaar
Apprentice
GroupMembers
Posts57
JoinedNov 24, 2016

 
Well I tried putting this in place in obj_cast_spell function and found it will cast the spell but still goes by the hard coded spell level and not obj->value[0] that the builder sets a wand or staff to be brandished too.

if ( skill->spell_fun != spell_smaug && obj )
{
  if((sn = skill_lookup(skill->name)) < 0)
       return 0;

    (*skill_table[sn]->spell_fun) (sn, obj->value[0], ch, vo);
       return 0;
}
else
retcode = (*skill->spell_fun) (sn, level, ch, vo);

Post is unread #4 Jul 19, 2023 3:20 am   
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts428
JoinedMar 7, 2005

 
Would you want to address this in things like do_brandish( ) and do_zap( ) rather than in obj_cast_spell( )?

What do yours currently look like where they call obj_cast_spell( )?

Pages:<< prev 1 next >>