Adherence to existing regulations can limit the impact of earthquakes