Had an experience like this as well. Sat down for a smoke and offered one to a chill looking homeless guy nearby. After we lit up some deranged crackhead runs up shouting "YALL GOT THA TIME??" etc., the standard attempts at getting you to pull your phone out so he can grab it and run. He was aggressive enough to make me nervous but the guy I was smoking with just shooed him off and we had a good conversation. It hurt me to see him out there because he seemed like a nice guy with a good head on his shoulders. Reminded me that a few strokes of bad luck could put me right where he is.
Also attended an Occupy rally in my city back when that was a thing. There were about five people there. Pitiful really. Ended up just talking to anybody passing by that was interested. Again offered a smoke to a chill homeless guy and had a good conversation. Ended up giving him a ride to a cheap motel he was staying in for the night. He pulled a joint out of his pocket, cracked it in half and gave me half. I thought that was really cool of him - he certainly needed something to relax with more than I did.
Sometimes I get frustrated with the generic cracked out hobos ambushing me as soon as I leave the office and practically demanding money, but I make a point of approaching the less pushy ones once in a while. Reminds me that many people out there are goodhearted and just need help.