Index: game/AFEntity.cpp
===================================================================
--- game/AFEntity.cpp	(revision 9755)
+++ game/AFEntity.cpp	(working copy)
@@ -1331,6 +1331,21 @@
 }
 
 /*
+================
+idAFEntity_Base::SetModel
+================
+*/
+void idAFEntity_Base::SetModel( const char *modelname ) {
+	idAnimatedEntity::SetModel(modelname);
+
+	if ( !GetAnimator()->ModelDef() ) {
+		//stgatilov #5845: can only switch AF model with compatible AF model
+		//because we don't (and cannot) change the body set in af.physicsObj
+		common->Error("idAFEntity_Base::SetModel: model %s is not modelDef", modelname);
+	}
+}
+
+/*
 ===============
 idAFEntity_Base::ShowEditingDialog
 ===============
Index: game/AFEntity.h
===================================================================
--- game/AFEntity.h	(revision 9755)
+++ game/AFEntity.h	(working copy)
@@ -221,6 +221,7 @@
 	virtual bool			GetPhysicsToVisualTransform( idVec3 &origin, idMat3 &axis );
 	virtual bool			UpdateAnimationControllers( void );
 	virtual void			FreeModelDef( void );
+	virtual void			SetModel( const char *modelname ) override;
 
 	virtual bool			LoadAF( void );
 	bool					IsActiveAF( void ) const { return af.IsActive(); }
