(do_conv) Move the initialization of the natp to be inside sector loop, this

allows the deity to use the research level of the sector owner.  This also
fixes the use of an uninitialized sector data structure.
This commit is contained in:
Ron Koenderink 2005-10-18 16:11:19 +00:00
parent 542709fae3
commit c469d1f179

View file

@ -81,13 +81,13 @@ do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real)
struct nstr_item ni; struct nstr_item ni;
long cost = 0; long cost = 0;
natp = getnatp(sect.sct_own);
totaluw = 0; totaluw = 0;
while (nxtsct(&nstr, &sect)) { while (nxtsct(&nstr, &sect)) {
if (!player->owner) if (!player->owner)
continue; continue;
if (sect.sct_oldown == player->cnum) if (sect.sct_oldown == player->cnum)
continue; continue;
natp = getnatp(sect.sct_own);
maxpop = max_pop(natp->nat_level[NAT_RLEV], &sect); maxpop = max_pop(natp->nat_level[NAT_RLEV], &sect);
civ = sect.sct_item[I_CIVIL]; civ = sect.sct_item[I_CIVIL];
mil = sect.sct_item[I_MILIT]; mil = sect.sct_item[I_MILIT];