Compare against pointers

This commit is contained in:
Anonymous Maarten 2022-11-08 20:17:31 +01:00
parent 8a6fefaf46
commit bcc42f3a01
3 changed files with 4 additions and 4 deletions

View File

@ -604,8 +604,8 @@ void BrModelUpdate(br_model* model, br_uint_16 flags) {
if (model->flags & BR_MODF_PREPREPARED) {
return;
}
if (!model->faces || !model->vertices) {
BrFailure("BrModelUpdate: model has no faces or vertices (%s)", model->identifier ? model->identifier : "<NULL>");
if (model->faces == NULL || model->vertices == NULL) {
BrFailure("BrModelUpdate: model has no faces or vertices (%s)", model->identifier != NULL ? model->identifier : "<NULL>");
}
if (flags & BR_MODU_UNKNOWN) {
flags |= BR_MODU_NORMALS;

View File

@ -1687,7 +1687,7 @@ void MungeWindscreen(br_model* pModel) {
void SetModelFlags(br_model* pModel, int pOwner) {
LOG_TRACE("(%p, %d)", pModel, pOwner);
if (pModel && pModel->nfaces) {
if (pModel != NULL&& pModel->nfaces != 0) {
#if defined(DETHRACE_FIX_BUGS) /* Show Squad Car in the wreck gallery. */
if (gAusterity_mode) {
#else

View File

@ -368,7 +368,7 @@ br_pixelmap* DRPixelmapAllocate(br_uint_8 pType, br_uint_16 pW, br_uint_16 pH, v
br_pixelmap* the_map;
the_map = BrPixelmapAllocate(pType, pW, pH, pPixels, pFlags);
if (the_map) {
if (the_map != NULL) {
the_map->origin_y = 0;
the_map->origin_x = 0;
}