Login
User Name:

Password:



Register

Forgot your password?
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
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
AhrefsBot

Members: 0
Guests: 40
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» 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
Posts413
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 >>