The idea that T. rex was an obligate scavenger was promoted by a few paleontologists that wanted to get into the spotlight. To my knowledge, the only terrestrial vertebrates that can 'make it' as obligate scavengers are vultures. Vultures, of course, are capable of soaring flight and can scan vast landscapes for carrion. A terrestrial carnivore/scavenger is far more limited in terms of area covered. Therefore, the majority of terrestrial carnivores will capture and/or scavenge whatever they can. Lions and leopards, as only two examples, capture a lot of prey but, on the other hand, will eat carrion so rotten that it would give a vulture pause. Crocs and alligators, of course, are amphibious and will devour whatever they can get. They eat primarily fish but will also capture unwary drinkers and swimmers. They will happily devour a rotten carcass if they can find it.
T. rex [By the way, why is it always T. rex? There were larger and even more fearful dinosaurian predators.] was an elephant-sized carnivore [big, but a mere fraction of the size of the movies' Godzilla] that was probably warm-blooded and likely required a lot of meat. It was also land bound with a good sniffer. If it had relied entirely on dinosaurs that just happened to drop dead, it would likely have starved to death. Therefore it was almost certainly opportunistic. It would happily eat carrion, just as will a wolf, but it would also ambush/run down living prey. It simply had to.
In terms of 'stupid', well, it was smart enough--probably roughly as smart as a turkey or road runner. It was likely a little 'smarter' than most of its prey and probably a little more intelligent than present day alligators and crocs. Some large mammals will 'charge' out of emotions that look like anger and fear. Emotions like this may beyond dinosaurs and birds [although ravens and some parrots, despite small brains, are plenty intelligent], so probably dinosaurs probably didn't charge out of emotion. Some may have quite instinctively defended their ground--their territory--against perceived threats. One example of an unintelligent, but highly instinctive, creature that will defend itself vigorously, is the fire ant. Certain bees, hornets and wasps are also highly defensive/aggressive. These are invertebrates, however, hard-wired for active and aggressive defense. Poisonous snakes--terrestrial vertebrates--will also oftentimes put up a vigorous defense but will almost always crawl away if given the opportunity although I've heard of healthy black mambas running down and biting people and other animals. Every black mamba I've encountered, though, got out of Dodge in a hurry.