If a passenger be injured while on the platform of any car, or while in any mail, express, baggage or freight car, or on the locomotive, or while his or her head, limbs or body is projected outside the window or door of any passenger car, in violation of the printed regulations of said corporation posted up at the time, in a conspicuous place inside of the passenger cars then in the train, or in violation of any verbal instructions given by any officer of the train, such passenger shall be deemed guilty of contributory negligence, and such corporation shall not be liable for such injury: provided, that there was, at the time, inside of its passenger cars, room sufficient for the accommodation of such passenger.
NMS § 63-3-6