make an object named after someone listed in the scoreboard file; never returns Null */
| 2224 | /* make an object named after someone listed in the scoreboard file; |
| 2225 | never returns Null */ |
| 2226 | struct obj * |
| 2227 | mk_tt_object( |
| 2228 | int objtype, /* CORPSE or STATUE */ |
| 2229 | coordxy x, coordxy y) |
| 2230 | { |
| 2231 | struct obj *otmp; |
| 2232 | boolean initialize_it; |
| 2233 | |
| 2234 | /* player statues never contain books */ |
| 2235 | initialize_it = (objtype != STATUE); |
| 2236 | otmp = mksobj_at(objtype, x, y, initialize_it, FALSE); |
| 2237 | |
| 2238 | /* tt_oname() will return null if the scoreboard is empty, which in |
| 2239 | turn leaves the random corpsenm value; force it to match a player */ |
| 2240 | if (!tt_oname(otmp)) { |
| 2241 | int pm = rn1(PM_WIZARD - PM_ARCHEOLOGIST + 1, PM_ARCHEOLOGIST); |
| 2242 | |
| 2243 | /* update weight for either, force timer sanity for corpses */ |
| 2244 | set_corpsenm(otmp, pm); |
| 2245 | } |
| 2246 | |
| 2247 | return otmp; |
| 2248 | } |
| 2249 | |
| 2250 | /* make a new corpse or statue, uninitialized if a statue (i.e. no books); |
| 2251 | never returns Null */ |
no test coverage detected