… | |
… | |
163 | * state. |
163 | * state. |
164 | */ |
164 | */ |
165 | void |
165 | void |
166 | init_experience () |
166 | init_experience () |
167 | { |
167 | { |
168 | char buf[MAX_BUF], *cp; |
|
|
169 | int lastlevel = 0, comp; |
168 | int lastlevel = 0; |
170 | sint64 lastexp = -1, tmpexp; |
169 | sint64 lastexp = -1; |
171 | |
170 | |
172 | sprintf (buf, "%s/exp_table", settings.confdir); |
171 | object_thawer thawer (settings.datadir, "exp_table"); |
173 | |
|
|
174 | object_thawer thawer (buf); |
|
|
175 | |
172 | |
176 | if (!thawer) |
173 | if (!thawer) |
177 | { |
174 | { |
178 | LOG (llevError, "unable to parse experience table file"); |
175 | LOG (llevError, "unable to parse experience table file"); |
179 | return; |
176 | return; |
… | |
… | |
189 | |
186 | |
190 | sint64 newlevels [MAXNUMLEVELS]; |
187 | sint64 newlevels [MAXNUMLEVELS]; |
191 | |
188 | |
192 | while (thawer.next_line ()) |
189 | while (thawer.next_line ()) |
193 | { |
190 | { |
|
|
191 | sint64 tmpexp; |
194 | thawer.get (tmpexp); |
192 | thawer.get (tmpexp); |
195 | |
193 | |
196 | /* Do some sanity checking - if value is bogus, just exit because |
194 | /* Do some sanity checking - if value is bogus, just exit because |
197 | * the table otherwise is probably in an inconsistent state |
195 | * the table otherwise is probably in an inconsistent state |
198 | */ |
196 | */ |