Ticket #679 (closed bug: fixed)

Opened 14 months ago

Last modified 10 months ago

High-level mages get told they can learn 1 more spell when there are no more spells left to learn

Reported by: takkaria Owned by: magnate
Milestone: 3.1.1 beta Keywords:
Cc:

Description


Attachments

Change History

Changed 10 months ago by magnate

  • owner set to magnate
  • status changed from new to assigned

Changed 10 months ago by magnate

Confirmed - there are 58 spells in the 9 books, and they can learn 59 with maxed INT. Problem is somewhere in calc_spells (player/calcs.c) but I can't see it yet. Something to do with num_allowed or PY_MAX_SPELLS etc.

Changed 10 months ago by noz

Spell 7 (used to be Detect Objects) no longer exists, so the spell level is zero. When the number of available spells is counted, the condition is if spell_level <= player_level, then count it. However, this will end up counting an extra 1 for spell 7.

Fix:

Index: src/player/calcs.c
===================================================================
--- src/player/calcs.c	(revision 1401)
+++ src/player/calcs.c	(working copy)
@@ -196,8 +196,8 @@
 		/* Get the spell */
 		s_ptr = &mp_ptr->info[j];
 
-		/* Skip spells we cannot remember */
-		if (s_ptr->slevel > p_ptr->lev) continue;
+		/* Skip spells we cannot remember or don't exist */
+		if (s_ptr->slevel > p_ptr->lev || s_ptr->slevel == 0) continue;
 
 		/* Skip spells we already know */
 		if (p_ptr->spell_flags[j] & PY_SPELL_LEARNED)

Changed 10 months ago by magnate

  • status changed from assigned to closed
  • resolution set to fixed

r1403. Thanks to Peter Denison for the patch.

Add/Change #679 (High-level mages get told they can learn 1 more spell when there are no more spells left to learn)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.