more verbose error when out of range

This commit is contained in:
David Rose 2004-10-14 22:20:51 +00:00
parent bf95301ca2
commit 66c6df9d92

View File

@ -276,9 +276,23 @@ finish_send_update(DCPacker &packer) {
packer.pop();
bool pack_ok = packer.end_pack();
nassertv(pack_ok);
if (pack_ok) {
Datagram dg(packer.get_data(), packer.get_length());
_repository->send_datagram(dg);
} else {
#ifndef NDEBUG
if (packer.had_range_error()) {
ostringstream error;
error << "Node position out of range for DC file: "
<< _node_path << " pos = " << _node_path.get_pos()
<< " hpr = " << _node_path.get_hpr();
nassert_raise(error.str());
} else {
nassert_raise("Unexpected pack error in DC file.");
}
#endif
}
}