MCPcopy Create free account
hub / github.com/OpenMW/openmw / loadCell

Function loadCell

apps/esmtool/esmtool.cpp:225–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223{
224
225 void loadCell(const Arguments& info, ESM::Cell& cell, ESM::ESMReader& esm, ESMData* data)
226 {
227 bool quiet = (info.quiet_given || info.mode == "clone");
228 bool save = (info.mode == "clone");
229
230 // Skip back to the beginning of the reference list
231 // FIXME: Changes to the references backend required to support multiple plugins have
232 // almost certainly broken this following line. I'll leave it as is for now, so that
233 // the compiler does not complain.
234 cell.restore(esm, 0);
235
236 // Loop through all the references
237 ESM::CellRef ref;
238 if (!quiet)
239 std::cout << " References:\n";
240
241 bool deleted = false;
242 ESM::MovedCellRef movedCellRef;
243 bool moved = false;
244 while (cell.getNextRef(esm, ref, deleted, movedCellRef, moved))
245 {
246 if (data != nullptr && save)
247 data->mCellRefs[&cell].push_back(std::make_pair(ref, deleted));
248
249 if (quiet)
250 continue;
251
252 std::cout << " - Refnum: " << ref.mRefNum.mIndex << '\n';
253 std::cout << " ID: " << ref.mRefID << '\n';
254 std::cout << " Position: (" << ref.mPos.pos[0] << ", " << ref.mPos.pos[1] << ", " << ref.mPos.pos[2]
255 << ")\n";
256 std::cout << " Rotation: (" << osg::RadiansToDegrees(ref.mPos.rot[0]) << ", "
257 << osg::RadiansToDegrees(ref.mPos.rot[1]) << ", " << osg::RadiansToDegrees(ref.mPos.rot[2])
258 << ")\n";
259 if (ref.mScale != 1.f)
260 std::cout << " Scale: " << ref.mScale << '\n';
261 if (!ref.mOwner.empty())
262 std::cout << " Owner: " << ref.mOwner << '\n';
263 if (!ref.mGlobalVariable.empty())
264 std::cout << " Global: " << ref.mGlobalVariable << '\n';
265 if (!ref.mFaction.empty())
266 std::cout << " Faction: " << ref.mFaction << '\n';
267 if (!ref.mFaction.empty() || ref.mFactionRank != -2)
268 std::cout << " Faction rank: " << ref.mFactionRank << '\n';
269 std::cout << " Enchantment charge: " << ref.mEnchantmentCharge << '\n';
270 std::cout << " Uses/health: " << ref.mChargeInt << '\n';
271 std::cout << " Count: " << ref.mCount << '\n';
272 std::cout << " Blocked: " << static_cast<int>(ref.mReferenceBlocked) << '\n';
273 std::cout << " Deleted: " << deleted << '\n';
274 if (!ref.mKey.empty())
275 std::cout << " Key: " << ref.mKey << '\n';
276 std::cout << " Lock level: " << ref.mLockLevel << '\n';
277 if (!ref.mTrap.empty())
278 std::cout << " Trap: " << ref.mTrap << '\n';
279 if (!ref.mSoul.empty())
280 std::cout << " Soul: " << ref.mSoul << '\n';
281 if (ref.mTeleport)
282 {

Callers 8

loadMethod · 0.85
loadCellMethod · 0.85
loadCellMethod · 0.85
loadTes3Function · 0.85
changeCellGridMethod · 0.85
testExteriorCellsMethod · 0.85
testInteriorCellsMethod · 0.85
changeToInteriorCellMethod · 0.85

Calls 3

getNextRefMethod · 0.80
restoreMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected